Commit 91f3997e authored by Joshua M. Clulow's avatar Joshua M. Clulow Committed by Brad Fitzpatrick
Browse files

runtime: make NumCPU respect zone CPU cap on illumos

On illumos systems, check for the "zone.cpu-cap" resource control when
determining how many usable CPUs are available.  If the resource control
is not set, or we are unable to read it, ignore the failure and return
the value we used to return; i.e., the CPU count from
sysconf(_SC_NPROCESSORS_ONLN).

Fixes golang/go#35199

Change-Id: Ic8a408f84cd140d544d128f1281baad527fb5e35
Reviewed-on: https://go-review.googlesource.com/c/go/+/203758


Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 503bccb5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment