Re: [PATCH v1 2/2] PM: Add config flag to gate sysfs wakeup_sources

Samuel Wu
2026-03-21T00:46:55Z

On Fri, Mar 20, 2026 at 9:09 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
>

[ ... ]

> >
> > +config PM_WAKEUP_STATS_SYSFS
> > + bool "Sysfs wakeup statistics"
> > + depends on PM_SLEEP
> > + default y
> > + help
> > + Enable this for wakeup statistics in sysfs under /sys/class/wakeup/
> > +
> > + Disabling this option eliminates the work of creating the wakeup
> > + sources and each of their attributes in sysfs. Depending on the
> > + number of wakeup sources, this can also have a non-negligible memory
> > + impact. Regardless of this config option's value, wakeup statistics
> > + are still available via debugfs and BPF.
>
> Well, except that otherwise it may be hard to figure out which device
> the given wakeup source belongs to, so I'd rather not do that.
>

Since the config flag defaults to yes, this wouldn't affect current
users right? And then the idea is that other users who don't need this
sysfs node can turn the flag off to save some cycles and memory.

[ ... ]