]> Cypherpunks repositories - gostls13.git/commit
runtime: make NumCPU respect zone CPU cap on illumos
authorJoshua M. Clulow <josh@sysmgr.org>
Mon, 28 Oct 2019 16:19:48 +0000 (09:19 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 28 Oct 2019 18:06:12 +0000 (18:06 +0000)
commit91f3997ec09d6502f88471f384aad2fe3ddcecb9
tree10987550fafd88ec19be7c7944217f2844b423b2
parent503bccb5d91998e22e32c6f771262ed33b72ff8b
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: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/defs_illumos_amd64.go [new file with mode: 0644]
src/runtime/os3_solaris.go
src/runtime/os_illumos.go [new file with mode: 0644]
src/runtime/os_only_solaris.go [new file with mode: 0644]