Kir KolyshkinandClaude Sonnet 4.5 690c91f6ec unix: add CPUSetDynamic for systems with more than 1024 CPUs
The existing CPUSet type is a fixed-size array limited to 1024 CPUs,
which makes it problematic to use for large systems (such as Google's
X4 instances with 1440 and 1920 vCPUs), see e.g.
https://github.com/opencontainers/runc/issues/5023.

Introduce CPUSetDynamic type and NewCPUSet constructor to support large
systems. The bit-managing routines (set/clear/isset/fill/count) are
separated and reused.

Add variants of SchedGetaffinity, SchedSetaffinity and SetMemPolicy
that accept the new type.

Amend the documentation for CPUSet.

Amend the existing TestSchedSetaffinity to:
 - test set.Fill;
 - use t.Cleanup to restore the affinity.

Add tests for new functionality (mostly a copy of existing tests).

This is an alternative to CL 727540 / CL 727541.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Change-Id: I51bba0305b8dfa7a88a4e7fb8758d73f798574f1
Reviewed-on: https://go-review.googlesource.com/c/sys/+/735380
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-04-08 16:32:30 -07:00
2023-10-11 21:54:30 +00:00
2015-03-18 17:04:21 +00:00
2024-07-16 16:11:15 +00:00
2024-11-02 04:18:59 +00:00

sys

Go Reference

This repository holds supplemental Go packages for low-level interactions with the operating system.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.

The git repository is https://go.googlesource.com/sys.

The main issue tracker for the sys repository is located at https://go.dev/issues. Prefix your issue with "x/sys:" in the subject line, so it is easy to find.

S
Description
[mirror] Go packages for low-level interaction with the operating system
Readme BSD-3-Clause
15 MiB
Languages
Go 85.7%
Assembly 12.4%
Shell 1.7%
C 0.1%