lkml.org 
[lkml]   [2023]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr()
On Wed, 18 Oct 2023 at 06:15, Uros Bizjak <ubizjak@gmail.com> wrote:
>
> Attached is the prototype patch that works for me (together with
> Linus' FPU switching patch).

That looks reasonable, but I think the separate compilation unit is
unnecessary, and I still absolutely hate how that const_pcpu_hot thing
is declared twice (your patch does it in both current.h and in
percpu-hot.c).

How about we just do the whole alias as a linker thing instead? So the
same way that we just do

jiffies = jiffies_64;

in our arch/x86/kernel/vmlinux.lds.S file, we could just do

const_pcpu_hot = pcpu_hot;

in there.

Then, as far as the compiler is concerned, we just have

DECLARE_PER_CPU_ALIGNED(
const struct pcpu_hot __percpu_seg_override,
const_pcpu_hot)

and the compiler doesn't know that it's aliased to anything else.

And please do that declaration in just *one* place.

Linus

\
 
 \ /
  Last update: 2023-10-18 18:14    [W:0.295 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site