Skip to content

Commit 441e903

Browse files
KAGA-KOKOsuryasaimadhu
authored andcommitted
x86/softirq: Disable softirq stacks on PREEMPT_RT
PREEMPT_RT preempts softirqs and the current implementation avoids do_softirq_own_stack() and only uses __do_softirq(). Disable the unused softirqs stacks on PREEMPT_RT to safe some memory and ensure that do_softirq_own_stack() is not used which is not expected. [ bigeasy: commit description. ] Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent b70e138 commit 441e903

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

arch/x86/include/asm/irq_stack.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185
IRQ_CONSTRAINTS, regs, vector); \
186186
}
187187

188+
#ifndef CONFIG_PREEMPT_RT
188189
#define ASM_CALL_SOFTIRQ \
189190
"call %P[__func] \n"
190191

@@ -201,6 +202,8 @@
201202
__this_cpu_write(hardirq_stack_inuse, false); \
202203
}
203204

205+
#endif
206+
204207
#else /* CONFIG_X86_64 */
205208
/* System vector handlers always run on the stack they interrupted. */
206209
#define run_sysvec_on_irqstack_cond(func, regs) \

arch/x86/kernel/irq_32.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ int irq_init_percpu_irqstack(unsigned int cpu)
132132
return 0;
133133
}
134134

135+
#ifndef CONFIG_PREEMPT_RT
135136
void do_softirq_own_stack(void)
136137
{
137138
struct irq_stack *irqstk;
@@ -148,6 +149,7 @@ void do_softirq_own_stack(void)
148149

149150
call_on_stack(__do_softirq, isp);
150151
}
152+
#endif
151153

152154
void __handle_irq(struct irq_desc *desc, struct pt_regs *regs)
153155
{

0 commit comments

Comments
 (0)