summaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2022-09-15 13:11:04 +0200
committerPeter Zijlstra <peterz@infradead.org>2022-10-17 16:41:05 +0200
commitc063a217bc0726c2560138229de5673dbb253a02 (patch)
tree2cd279066be02c20600ed0aa0d9a1e7e496ecb33 /arch/x86/include
parent7443b296e699e6922f5be243c8d2e316de8cacbe (diff)
downloadlinux-stable-c063a217bc0726c2560138229de5673dbb253a02.tar.gz
linux-stable-c063a217bc0726c2560138229de5673dbb253a02.tar.bz2
linux-stable-c063a217bc0726c2560138229de5673dbb253a02.zip
x86/percpu: Move current_top_of_stack next to current_task
Extend the struct pcpu_hot cacheline with current_top_of_stack; another very frequently used value. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20220915111145.493038635@infradead.org
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/current.h1
-rw-r--r--arch/x86/include/asm/processor.h4
2 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/include/asm/current.h b/arch/x86/include/asm/current.h
index 8ac6589e9a1b..2dd013128f1e 100644
--- a/arch/x86/include/asm/current.h
+++ b/arch/x86/include/asm/current.h
@@ -17,6 +17,7 @@ struct pcpu_hot {
struct task_struct *current_task;
int preempt_count;
int cpu_number;
+ unsigned long top_of_stack;
};
u8 pad[64];
};
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index c660700ecfc6..c345f3096c80 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -426,8 +426,6 @@ struct irq_stack {
char stack[IRQ_STACK_SIZE];
} __aligned(IRQ_STACK_SIZE);
-DECLARE_PER_CPU(unsigned long, cpu_current_top_of_stack);
-
#ifdef CONFIG_X86_64
struct fixed_percpu_data {
/*
@@ -566,7 +564,7 @@ static __always_inline unsigned long current_top_of_stack(void)
* and around vm86 mode and sp0 on x86_64 is special because of the
* entry trampoline.
*/
- return this_cpu_read_stable(cpu_current_top_of_stack);
+ return this_cpu_read_stable(pcpu_hot.top_of_stack);
}
static __always_inline bool on_thread_stack(void)