Part of the accepted-design index.
Calling-thread operations use Linux’s caller selector. Explicit operations
require a positive ThreadID, which prevents a zero ID from accidentally
targeting the caller. Carrying a numeric ID keeps the kernel’s PID namespace
and lifetime semantics visible. A worker owns its goroutine’s thread lock
and coordinates the lifetime of any ID it shares. The caller chooses when
to apply and observe affinity because each is a distinct kernel operation.
A sorted, immutable CPU set stores the requested IDs without allocating
space for every lower ID. The kernel boundary uses the existing
golang.org/x/sys/unix dynamic masks. The fixed upstream mask would truncate
IDs above 1023. Reads grow their word-aligned buffer when the kernel reports
that it is too small. The 65,536-bit ceiling bounds allocation and retries and
covers Linux 7.0’s amd64 and arm64 configurations. Writes submit the requested
mask directly. A userspace preflight or intersection could race with CPU
availability, cgroup changes, or target exit and obscure the kernel error.
Scheduler syscalls,
amd64 CPU limit,
arm64 CPU limit.
CPU policy and associated parameters use one sched_attr operation so policy and priority change together. The maintained x/sys type and operations own the current ABI. The original write prefix uses that same layout with the explicit shorter size because the upstream setter always supplies the full size. Keep prefix selection and the copied read size visible. Applying clamps on a prefix that cannot carry them fails before the syscall.
Keep time-sharing nice values, real-time priorities, deadline budgets, and utilization clamp selections in their own domains. Linux owns authority, admission, and configuration checks. Preserve observed SCHED_EXT identity while leaving BPF scheduler loading and workload policy to the external scheduler. Linux 7.0 scheduler UAPI.
Block I/O priority uses the existing syscall numbers with Linux’s packed class, level, and hint encoding. A group operation takes an explicit process group ID. Linux treats a group read as a best-priority observation and can partially apply a group write. Using the kernel group operation preserves that behavior without userspace enumeration or a rollback claim. Linux 7.0 I/O priority UAPI.