Currently go does not support machines that contains > 256 CPUs, as IBM's E880
that could host 1536 hardware thread, when configured with 192 CPU cores and
SMT (Symmetric Multi Thread) 8.
For example, when running a go program on this machine, I got, the following
problem[1]:
procresize: invalid arg
This is because of the following code:
_MaxGomaxprocs = 1 << 8
if old < 0 || old > _MaxGomaxprocs || nprocs <= 0 || nprocs > _MaxGomaxprocs { throw("procresize: invalid arg")
}
This patch just redefine _MAxGomaxprocs to 1 << 12.
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index e0137f7..508cecb 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -472,7 +472,7 @@ type p struct {
const (
// The max value of GOMAXPROCS.
// There are no fundamental restrictions on the value.
- _MaxGomaxprocs = 1 << 8
+ _MaxGomaxprocs = 1 << 12
)
I am going to ask to send the following patch upstream. Let see what the upstream community will say about it
commit 17857791d91cf31 944d266cb1dfd93 22cea8933f
Author: Breno Leitao <email address hidden>
Date: Mon Apr 4 16:09:55 2016 -0400
Increase _MaxGomaxprocs to support big machines
Currently go does not support machines that contains > 256 CPUs, as IBM's E880
that could host 1536 hardware thread, when configured with 192 CPU cores and
SMT (Symmetric Multi Thread) 8.
For example, when running a go program on this machine, I got, the following
problem[1]:
procresize: invalid arg
This is because of the following code:
_ MaxGomaxprocs = 1 << 8
if old < 0 || old > _MaxGomaxprocs || nprocs <= 0 || nprocs > _MaxGomaxprocs {
throw( "procresize: invalid arg")
}
This patch just redefine _MAxGomaxprocs to 1 << 12.
diff --git a/src/runtime/ runtime2. go b/src/runtime/ runtime2. go runtime2. go runtime2. go
index e0137f7..508cecb 100644
--- a/src/runtime/
+++ b/src/runtime/
@@ -472,7 +472,7 @@ type p struct {
const (
// The max value of GOMAXPROCS.
// There are no fundamental restrictions on the value.
- _MaxGomaxprocs = 1 << 8
+ _MaxGomaxprocs = 1 << 12
)
type schedt struct {