HomeFreeBSD

sched_4bsd: Rename the global runqueue

Description

sched_4bsd: Rename the global runqueue

In an upcoming change whose purpose is to stop having 4BSD always
allocate MAXCPU runqueues, wasting space on most machines, 'struct
td_sched' will store the CPU ID to which a thread is bound/pinned
instead of a pointer to the corresponding runqueue. As a consequence,
existing functions manipulating a thread's runqueue will need to point
to the inferred runqueue through a local variable. The name 'runq' is
the ideal one for these local variables, but before this change it
designated the global runqueue, also causing unnecessary ambiguity.

Thus, rename the global runqueue to the more explicit 'runq_global'.
Arguably, this should have been performed as part of commit e17c57b14ba9
("- Implement cpu pinning and binding. (...)").

No functional change (intended).

[olce: Massaged the commit message. Tested with source builds.]

Suggested by: olce
Reviewed by: olce
Tested by: olce
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D58065

(cherry picked from commit 26ef6665344823f405c7fafba5baaacd9baacf72)

Details

Provenance
Minsoo Choo <minsoo@minsoo.io>Authored on Jul 20 2026, 2:34 AM
olceCommitted on Sep 7 2026, 8:41 AM
Reviewer
olce
Differential Revision
D58065: sched_4bsd: rename runq to runq_global
Parents
rG58067171721d: sched_4bsd: Remove obsolete SMP scaling for ticks per priority level
Branches
Unknown
Tags
Unknown