Re: [PATCH] proc: faster /proc/*/status

From: Andrew Morton
Date: Tue Aug 09 2016 - 19:25:13 EST


On Sun, 07 Aug 2016 14:22:31 -0700 Joe Perches <joe@xxxxxxxxxxx> wrote:

> On Sun, 2016-08-07 at 10:44 -0700, Andi Kleen wrote:
> > > > > It is so bloated that gcc needs to be asked to not screw up with stack
> > > > > size.
> > > > What happens when you drop all the noinlines for this? I assume
> > > > this would alread make it faster. And now that we have bigger
> > > > stacks we can likely tolerate it.
> > > %pV recurses through these code paths.
> > > I believe the maximum current recursion depth is 3.
> > I assume 2 max would sufficient for all users in kernel.
> >
> > And perhaps it would be better to get rid of "features" like this,
> > and instead focus on more common cases.
>
> It'd be a dubious trade-off in my opinion.
>
> Overall code size has been reduced by hundreds of KB
> by using %pV.

I kinda like Alexey's patch just for aesthetic reasons. Those huge
straggly printk-style statements are a real pain to maintain, trying to
keep the control string and the args in sync. Especially when there are
ifdefs everywhere - take a look at meminfo_proc_show() and weep. Geeze
the number of times I've had to maintain (and screw up) conflicts in
that thing...