Re: [PATCH 2/4] sched/isolation: clean up housekeeping_cpu
From: Frederic Weisbecker
Date: Fri Apr 11 2025 - 07:13:04 EST
Le Fri, Apr 11, 2025 at 08:58:45AM +0800, Alex Shi a écrit :
> Frederic Weisbecker <frederic@xxxxxxxxxx> 于2025年4月10日周四 21:20写道:
> >
> > Le Thu, Apr 10, 2025 at 05:24:17PM +0800, alexs@xxxxxxxxxx a écrit :
> > > From: Alex Shi <alexs@xxxxxxxxxx>
> > >
> > > housekeeping_test_cpu will check 'housekeeping_overridden' again in
> > > itself so we don't need do it again outside. just call
> > > housekeeping_test_cpu is fine.
> >
> > The point is to do it in the headers, so there is no function
> > call in the off case.
>
> Thanks for comments, Frederic,
> But the function is 'inline', and further more, the
> CONFIG_CPU_ISOLATION is in defconfig
> and most of puplar popular Linux vendor. So it still be compiled.
housekeeping_cpu() is inline and does the static branch test, which is
most of the time off. If it's on, then we enter the slow path and call
the real function housekeeping_test_cpu().
So the point is to optimize the fast path, which 99.999% of the uses
since nohz_full is a rare workload.
But housekeeping_test_cpu() is still built on most distros just in case
a distro user ever needs nohz_full.
Thanks.
--
Frederic Weisbecker
SUSE Labs