Re: [PATCH 0/5] x86/percpu semantics and fixes

From: Peter Zijlstra
Date: Sun Mar 10 2019 - 08:47:29 EST


On Fri, Mar 08, 2019 at 09:56:37PM +0100, Peter Zijlstra wrote:

> Anyway, can anybody explain percpu_stable_op() vs percpu_from_op() ?
>
> I'm thinking of a variant of Linus' patch, but I'm confused about the
> above.

So whatever I tried with +m only made things worse and always affects
thousands of symbols.

Now, afaict the whole percpu_stable_op thing is an ugly hack becaues some
earlier compiler would not CSE the regular percpu_from_op. But since it
does do that today; esp. after my first patch, I tried implementing
this_cpu_read_stable() with percpu_from_op() (no volatile, obv).

That also affects _lots_ of sites, but also significantly shrinks the
kernel image.

It's 2307 symbols affected, but:

17642871 2157438 747808 20548117 1398a15 defconfig-build1/vmlinux.o (patch 1)
17639081 2157438 747808 20544327 1397b47 defconfig-build0/vmlinux.o (patch 1 - percpu_stable_op)

So I think I'll add a patch removing percpu_stable_op and all its users.