mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/percpu: Declare const_pcpu_hot as extern const variable
@ 2023-11-30 16:27 Uros Bizjak
  2023-11-30 21:16 ` [tip: x86/percpu] " tip-bot2 for Uros Bizjak
  0 siblings, 1 reply; 5+ messages in thread
From: Uros Bizjak @ 2023-11-30 16:27 UTC (permalink / raw)
  To: x86, linux-kernel
  Cc: Uros Bizjak, kernel test robot, Andy Lutomirski, Brian Gerst,
	Denys Vlasenko, Ingo Molnar, H . Peter Anvin, Linus Torvalds,
	Peter Zijlstra, Thomas Gleixner, Josh Poimboeuf

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

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202311302257.tSFtZnly-lkp@intel.com/

Fixes: ed2f752e0e0a ("x86/percpu: Introduce const-qualified const_pcpu_hot to micro-optimize code generation")
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
 arch/x86/include/asm/current.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/current.h b/arch/x86/include/asm/current.h
index 0538d2436673..9fbd7cb2dc86 100644
--- a/arch/x86/include/asm/current.h
+++ b/arch/x86/include/asm/current.h
@@ -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)
 {
-- 
2.42.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-02  9:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-30 16:27 [PATCH] x86/percpu: Declare const_pcpu_hot as extern const variable Uros Bizjak
2023-11-30 21:16 ` [tip: x86/percpu] " tip-bot2 for Uros Bizjak
2023-12-01 12:46   ` Borislav Petkov
2023-12-01 16:41     ` Uros Bizjak
2023-12-02  9:40       ` Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®