Re: [RFC PATCH 0/4] x86/percpu: Use segment qualifiers

From: Linus Torvalds
Date: Sun Oct 01 2023 - 13:07:41 EST


On Sun, 1 Oct 2023 at 06:16, Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
>
> This patchset resurrect the work of Richard Henderson [1] and Nadav Amit [2]
> to introduce named address spaces compiler extension [3,4] into the linux kernel.

So apparently the extension has been around for a while (since gcc-6),
but I don't actually find any single major _user_ of it.

Debian code search finds exactly one case of it outside of the
compilers themselves:

# define THREAD_SELF \
(*(struct pthread *__seg_fs *) offsetof (struct pthread, header.self))

in glibc/sysdeps/x86_64/nptl/tls.h, and even that isn't very widely
used (it seems to be a pthread_mutex implementation helper).

So the coverage testing of this thing seems very weak. Do we have any
other reason to believe that this is likely to actually be reliable
enough to use?

Linus