Re: [PATCH 10/17] sched_ext: Add cmask, a base-windowed bitmap over cid space
From: Tejun Heo
Date: Wed Apr 29 2026 - 13:16:58 EST
Hello,
I'd rather raise the loop count than punt to a kernel slow-path. On
multi-socket Sapphire Rapids, banging on a shared cacheline with
kernel atomics hard enough can stall the machine to the point of
hard lockups. We don't know what BPF will do with these helpers and
they can pretty easily trigger similar conditions, so giving them
the ability to loop indefinitely in the kernel is exactly what we
want to avoid - we want to fail hard when this happens.
Bumping CMASK_CAS_TRIES to 1<<23 in v4 so abort fires only after
seconds of real spinning. As a follow-up, I want to add a kfunc to
let the BPF loops bail immediately when sch->aborting is set, so the
abort path doesn't keep banging the cacheline while the kernel is
tearing the scheduler down.
Switching to ctzll() too, thanks.
Thanks.
--
tejun