aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/os_linux.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2025-05-13 13:12:47 -0400
committerGopher Robot <gobot@golang.org>2025-05-19 12:47:30 -0700
commitdb956262ac4125693cffb517ea7aebf6ab04ec35 (patch)
tree3c93816c3dc43f4e273c84f7eb0c3f5b8896ccbb /src/runtime/os_linux.go
parent76e7bfbb4e3a6114a33c7dba666fdd26698bedc5 (diff)
downloadgo-db956262ac4125693cffb517ea7aebf6ab04ec35.tar.xz
runtime: rename ncpu to numCPUStartup
ncpu is the total logical CPU count at startup. It is never updated. For #73193, we will start using updated CPU counts for updated GOMAXPROCS, making the ncpu name a bit ambiguous. Change to a less ambiguous name. While we're at it, give the OS specific lookup functions a common name, so it can be used outside of osinit later. For #73193. Change-Id: I6a6a636cf21cc60de36b211f3c374080849fc667 Reviewed-on: https://go-review.googlesource.com/c/go/+/672277 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/os_linux.go')
-rw-r--r--src/runtime/os_linux.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go
index 3071e32202..54f98ef4f8 100644
--- a/src/runtime/os_linux.go
+++ b/src/runtime/os_linux.go
@@ -101,7 +101,7 @@ func futexwakeup(addr *uint32, cnt uint32) {
*(*int32)(unsafe.Pointer(uintptr(0x1006))) = 0x1006
}
-func getproccount() int32 {
+func getCPUCount() int32 {
// This buffer is huge (8 kB) but we are on the system stack
// and there should be plenty of space (64 kB).
// Also this is a leaf, so we're not holding up the memory for long.
@@ -354,7 +354,7 @@ func getHugePageSize() uintptr {
}
func osinit() {
- ncpu = getproccount()
+ numCPUStartup = getCPUCount()
physHugePageSize = getHugePageSize()
osArchInit()
vgetrandomInit()