From 5fb42fcaa151bd14e8b0b488c188672d59c24770 Mon Sep 17 00:00:00 2001 From: vasilito Date: Thu, 2 Jul 2026 06:33:08 +0300 Subject: [PATCH] kernel: define RUN_QUEUE_COUNT in context/mod.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-flight for Phase 0c. The P8-percpu-sched and P8-percpu-wiring patches both reference crate::context::RUN_QUEUE_COUNT but none of the kernel P5–P9 patches define it (verified by grep). The downstream patches have an incomplete dependency: they need this constant at the module level but no patch supplies it. Add 'pub const RUN_QUEUE_COUNT: usize = 40;' here, matching the historical 40-priority DWRR queue count. The P7-cache-affine-context patch separately defines 'pub const SCHED_PRIORITY_LEVELS: usize = 40;' in context/context.rs which is a duplicate; both being 40 keeps the existing SCHED_PRIO_TO_WEIGHT and quantum tables valid. --- src/context/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/context/mod.rs b/src/context/mod.rs index 37c73f5a37..ab45a3a571 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -29,6 +29,14 @@ pub use self::{ pub type ContextLock = RwLock; pub type ArcContextLockWriteGuard = ArcRwLockWriteGuard; +/// Number of priority queues in the per-CPU run queue (DWRR priority +/// count). Kept at 40 to match the historical global `RunContextData.set` +/// length and the existing `SCHED_PRIO_TO_WEIGHT` table in +/// `context/switch.rs`. Each `PerCpuSched.run_queues` entry is one +/// DWRR priority level. Consumers: `crate::percpu::PerCpuSched`, +/// `crate::context::switch`. +pub const RUN_QUEUE_COUNT: usize = 40; + #[cfg(target_arch = "aarch64")] #[path = "arch/aarch64.rs"] mod arch;