x86/percpu: Declare const_pcpu_hot as extern const variable

const_pcpu_hot is aliased by linker to pcpu_hot, so there is no need
to use the DECLARE_PER_CPU_ALIGNED() macro. Also, declare const_pcpu_hot
as extern to avoid allocating storage space for the aliased structure.

Fixes: ed2f752e0e ("x86/percpu: Introduce const-qualified const_pcpu_hot to micro-optimize code generation")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Uros Bizjak <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
This commit is contained in:
Uros Bizjak
2023-11-30 20:19:33 +01:00
committed by Ingo Molnar
parent 6724ba89e0
commit 4604c052b8
+1 -2
View File
@@ -37,8 +37,7 @@ static_assert(sizeof(struct pcpu_hot) == 64);
DECLARE_PER_CPU_ALIGNED(struct pcpu_hot, pcpu_hot);
/* const-qualified alias to pcpu_hot, aliased by linker. */
DECLARE_PER_CPU_ALIGNED(const struct pcpu_hot __percpu_seg_override,
const_pcpu_hot);
extern const struct pcpu_hot __percpu_seg_override const_pcpu_hot;
static __always_inline struct task_struct *get_current(void)
{