Re: [PATCH] sched/debug: Introduce per-CPU debugfs files
From: Aaron Tomlin
Date: Tue Jul 28 2026 - 09:49:29 EST
On Tue, Jul 28, 2026 at 12:48:49PM +0200, Peter Zijlstra wrote:
> On Mon, Jul 27, 2026 at 10:03:09PM -0400, Aaron Tomlin wrote:
> > Currently, accessing scheduler debugging details for a specific CPU
> > requires reading /sys/kernel/debug/sched/debug, which outputs
> > information for all online CPUs. This results in redundant output and
> > parsing overhead on large SMP systems when targeting an individual CPU.
> >
> > Add support for per-CPU debug files under:
> > /sys/kernel/debug/sched/cpu/cpu<N>/debug. Reading
> > /sys/kernel/debug/sched/cpu/cpu<N>/debug calls print_cpu() specifically
> > for CPU <N>, exposing CPU-specific runqueue details on demand.
>
> You're failing to explain why though. In what situation does the
> overhead from sched/debug matter one whit? If you're dumping this at
> frequencies high enough for this to matter, you're doing something
> terribly wrong.
Hi Peter,
Thank you for your feedback.
Fair point. To be clear, this is certainly not intended for high-frequency
polling or automated monitoring in production hot loops.
When investigating a latency anomaly or scheduling issue isolated to a
specific CPU, I find that accessing cpu<N>/debug provides an immediate,
targeted view of that runqueue. As mentioned to Zhan [1], I shall rewrite
the commit message in v2 to properly articulate this rationale.
[1]: https://lore.kernel.org/lkml/uz622xhp6nejphseptcwjg6mnuuvrb3tu6gpzc55oqbqtlfmmh@4nltaa6ucce2/
Kind regards,
--
Aaron Tomlin