diff --git a/crates/job_mix/src/lib.rs b/crates/job_mix/src/lib.rs index c9c16c66b..e449d0e0d 100644 --- a/crates/job_mix/src/lib.rs +++ b/crates/job_mix/src/lib.rs @@ -452,7 +452,7 @@ pub const MAX_TASKS: usize = 32; /// AIM7 increments by one and runs until throughput collapses. This doubles, because a run on a /// board is an evening of somebody's time and the interesting feature (a knee, or its absence) is /// visible on a log axis. 1 is the control: a single task with the whole machine. -pub const TASK_SWEEP: [usize; 6] = [1, 2, 4, 8, 16, MAX_TASKS]; +pub const TASK_SWEEP: [usize; 4] = [1, 2, 3, 4]; /// **Measured repeats per subrun, and the statistic is their median, not their best** (changed /// 2026-09-19; it was three repeats and the best of them until then). diff --git a/fixtures/src/job_mix_task.rs b/fixtures/src/job_mix_task.rs index a28dfcb7c..e5016ca67 100644 --- a/fixtures/src/job_mix_task.rs +++ b/fixtures/src/job_mix_task.rs @@ -404,6 +404,17 @@ pub extern "C" fn _start(role: u64, index: u64, seed: u64) -> ! { let t0 = now(); let mut failed = None; let mut round = 0; + // SCRATCH (lane/null-system-call-hvf, condition C, never committed): every task but task 0 + // is system-call-free load, 40 times the mix's job count of `compute`, charged to no kind, so + // the per-kind lines are task 0's alone and the load outlasts task 0's subrun. + if index != 0 { + let mut j = 0; + while j < job_mix::JOBS_PER_TASK * 40 { + acc = grind(job_mix::COMPUTE_ITERS, acc); + j += 1; + } + round = job_mix::ROUNDS_PER_TASK; + } 'subrun: while round < job_mix::ROUNDS_PER_TASK { for &job in &order { // Two counter reads per job, and neither is a system call on any architecture this diff --git a/fixtures/src/job_mix_task.rs b/fixtures/src/job_mix_task.rs index a28dfcb7c..9a89b57f7 100644 --- a/fixtures/src/job_mix_task.rs +++ b/fixtures/src/job_mix_task.rs @@ -204,6 +204,7 @@ fn map_job() -> Result { /// finishing its exit, which is the scheduler's time and not the allocator's. #[inline(never)] fn spawn_job(code_frame: u64) -> Result { + if true { let _ = code_frame; return Ok(0); } // SCRATCH: HVF experiment, never committed let mut region_ticks = 0; let mut n = 0; while n < job_mix::SPAWN_CALLS { diff --git a/kernel/src/sched.rs b/kernel/src/sched.rs index dfec56531..6c7a34d58 100644 --- a/kernel/src/sched.rs +++ b/kernel/src/sched.rs @@ -4752,6 +4752,11 @@ pub fn delete_current_cap(slot: u64) -> Result<(), crate::cap::Error> { /// copy to keep warm. Milestone 368 (`script/fastpath-footprint`'s entry set is flat) holds the /// other instances of this shape. #[inline(never)] +/// SCRATCH (lane/null-system-call-hvf, never committed). +pub fn scratch_ipc_tables_lock() -> impl Drop { + IPC_TABLES.lock() +} + pub fn current_cap(slot: u64) -> Result { // **No `IPC_TABLES` here** (2026-10-04 UTC): the running thread's own table, under its own lock. // This was the global lock on every capability system call, and on radon at four busy cores 41% of diff --git a/kernel/src/system_call.rs b/kernel/src/system_call.rs index 458d76095..dfda85a29 100644 --- a/kernel/src/system_call.rs +++ b/kernel/src/system_call.rs @@ -134,6 +134,9 @@ pub fn invoke( a1: u64, a2: u64, ) -> Result { + // SCRATCH ABLATION (lane/null-system-call-hvf, never committed): the invoke path waits for the + // global lock before its lookup, as every lookup did before milestone 761 (capability lookup off the global lock). + drop(sched::scratch_ipc_tables_lock()); let cap = sched::current_cap(slot).map_err(|_| Error::NoSuchSlot)?; match cap.object { diff --git a/kernel/src/cpu.rs b/kernel/src/cpu.rs index 7fd982a82..4327ee9b2 100644 --- a/kernel/src/cpu.rs +++ b/kernel/src/cpu.rs @@ -53,6 +53,8 @@ pub const MAX_CPUS: usize = current_cpu_contract::CPU_ID_BOUND; /// /// Aligned to 256 on x86_64 so its size stays a power of two; see the assertion below [`PERCPU`]. #[cfg_attr(target_arch = "x86_64", repr(align(256)))] +// SCRATCH (lane/null-system-call-hvf, never committed): one block per 128-byte Apple line. +#[cfg_attr(target_arch = "aarch64", repr(align(128)))] pub struct PerCpu { /// The lowest lock rank this core currently holds (`rank::NONE` when it holds nothing). /// diff --git a/kernel/src/cpu.rs b/kernel/src/cpu.rs index 7fd982a82..f97b37eb8 100644 --- a/kernel/src/cpu.rs +++ b/kernel/src/cpu.rs @@ -353,7 +353,15 @@ static ADOPTED: [AtomicU64; MAX_CPUS] = [const { AtomicU64::new(0) }; MAX_CPUS]; /// /// Statically allocated on purpose: a core's block must be reachable from its first instruction /// of Rust, long before any allocator exists. `TPIDR_EL1` points at one element of this array. -static PERCPU: [PerCpu; MAX_CPUS] = [const { PerCpu::new() }; MAX_CPUS]; +// SCRATCH (lane/percpu-own-line, never committed): the positive control. Puts the blocks at 24 +// mod 128, the parent lane's condition A layout, which today's link happens not to. +#[repr(C, align(128))] +struct Shifted { + _pad: [u8; 24], + blocks: [PerCpu; MAX_CPUS], +} +static PERCPU_SHIFTED: Shifted = Shifted { _pad: [0; 24], blocks: [const { PerCpu::new() }; MAX_CPUS] }; +static PERCPU: &[PerCpu; MAX_CPUS] = &PERCPU_SHIFTED.blocks; /// **`PerCpu`'s size must stay a power of two, and this is the check that says so.** /// Added by milestone 541 (a timed window that excludes preemption).