Re: [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set

From: Michal Hocko
Date: Tue Mar 12 2019 - 12:44:26 EST


On Wed 13-03-19 00:29:57, Yafang Shao wrote:
> On Wed, Mar 13, 2019 at 12:18 AM Michal Hocko <mhocko@xxxxxxxxxx> wrote:
> >
> > On Sat 02-03-19 12:38:58, Yafang Shao wrote:
> > > Only mm_compaction_isolate_{free, migrate}pages may be used when
> > > CONFIG_COMPACTION is not set.
> > > All others are used only when CONFIG_COMPACTION is set.
> >
> > Why is this an improvement?
> >
>
> After this change, if CONFIG_COMPACTION is not set, the tracepoints
> that only work when CONFIG_COMPACTION is set will not be exposed to
> the usespace.
> Without this change, they will always be expose in debugfs no matter
> CONFIG_COMPACTION is set or not.

And this is exactly something that the changelog should mention. I
wasn't aware that we do export tracepoints even when they are not used
by any code path. This whole macro based programming is just a black
magic.
--
Michal Hocko
SUSE Labs