Skip to content

Commit 4604c05

Browse files
ubizjakIngo Molnar
authored andcommitted
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: ed2f752 ("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]/
1 parent 6724ba8 commit 4604c05

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/x86/include/asm/current.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ static_assert(sizeof(struct pcpu_hot) == 64);
3737
DECLARE_PER_CPU_ALIGNED(struct pcpu_hot, pcpu_hot);
3838

3939
/* const-qualified alias to pcpu_hot, aliased by linker. */
40-
DECLARE_PER_CPU_ALIGNED(const struct pcpu_hot __percpu_seg_override,
41-
const_pcpu_hot);
40+
extern const struct pcpu_hot __percpu_seg_override const_pcpu_hot;
4241

4342
static __always_inline struct task_struct *get_current(void)
4443
{

0 commit comments

Comments
 (0)