Re: [PATCH v2 4/4] x86/percpu: Use C for percpu read/write accessors

From: Ingo Molnar
Date: Thu Oct 05 2023 - 10:07:36 EST



* Uros Bizjak <ubizjak@xxxxxxxxx> wrote:

> The percpu code mostly uses inline assembly. Using segment qualifiers
> allows to use C code instead, which enables the compiler to perform
> various optimizations (e.g. propagation of memory arguments). Convert
> percpu read and write accessors to C code, so the memory argument can
> be propagated to the instruction that uses this argument.

> text data bss dec hex filename
> 25508862 4386540 808388 30703790 1d480ae vmlinux-vanilla.o
> 25500922 4386532 808388 30695842 1d461a2 vmlinux-new.o

Ok, this all looks like a pretty nice optimization.

As discussed previously, I've created a new tip:x86/percpu topic branch
for this, based on tip:x86/asm that carries the other percpu patches.
This branch will be merged in v6.8, best-case scenario.

Also note that I lowered the version cutoff from GCC 13.1 to 12.1, for
the simple selfish reason to include my own daily systems in test coverage.

Is there any known bug fixed in the GCC 12.1 ... 13.1 version range that
could make this approach problematic?

Thanks,

Ingo