Re: [PATCH 4/9] sched: Move SCHED_DEBUG to debugfs

From: Peter Zijlstra
Date: Wed Apr 07 2021 - 08:27:51 EST


On Wed, Apr 07, 2021 at 11:46:43AM +0100, Valentin Schneider wrote:
> On 26/03/21 11:33, Peter Zijlstra wrote:
> > __read_mostly bool sched_debug_enabled;
> >
> > +struct dentry *debugfs_sched;
> > +
> > static __init int sched_init_debug(void)
> > {
> > - debugfs_create_file("sched_features", 0644, NULL, NULL,
> > - &sched_feat_fops);
> > + struct dentry __maybe_unused *numa;
> > +
> > + debugfs_sched = debugfs_create_dir("sched", NULL);
> > +
> > + debugfs_create_file("features", 0644, debugfs_sched, NULL, &sched_feat_fops);
> > + debugfs_create_bool("debug_enabled", 0644, debugfs_sched, &sched_debug_enabled);
> > +
>
> Could we kill this too? I'm probably biased because I've spent some amount
> of time banging my head at topology problems, but this two-tiered debugging
> setup (KCONFIG + cmdline or post-boot write) has always irked me.
>
> I can't find the threads in a hurry, but ISTR justifications for keeping
> this around were:
> - Most distros have CONFIG_SCHED_DEBUG=y because knobs and ponies
> - Topology debug prints are "too verbose"

^^ that mostly.

> - NUMA distance matrix processing gets slower
>
> If we make it so distros stop / don't need to select CONFIG_SCHED_DEBUG,

We're not there yet, I think :-(

> then I don't think the above really stands anymore (also, sched_init_numa()
> now has the same complexity regardless of sched_debug), and we could keep
> everything under CONFIG_SCHED_DEBUG.

But yes, the reason this knob exists is ebcause I too frequently forget
to add the boot time knob, so I added this one to enable it at runtime
and then I get topology prints when I hotplug cycle a cpu.