genirq: Provide irq_enter/exit_rcu()
irq_enter()/exit() currently include RCU handling. To properly separate the RCU handling code, provide variants which contain only the non-RCU related functionality. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Andy Lutomirski <luto@kernel.org> Link: https://lore.kernel.org/r/20200521202117.567023613@linutronix.de
This commit is contained in:
parent
9ee01e0f69
commit
8a6bc4787f
2 changed files with 38 additions and 10 deletions
|
@ -40,7 +40,11 @@ static __always_inline void rcu_irq_enter_check_tick(void)
|
||||||
/*
|
/*
|
||||||
* Enter irq context (on NO_HZ, update jiffies):
|
* Enter irq context (on NO_HZ, update jiffies):
|
||||||
*/
|
*/
|
||||||
extern void irq_enter(void);
|
void irq_enter(void);
|
||||||
|
/*
|
||||||
|
* Like irq_enter(), but RCU is already watching.
|
||||||
|
*/
|
||||||
|
void irq_enter_rcu(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exit irq context without processing softirqs:
|
* Exit irq context without processing softirqs:
|
||||||
|
@ -55,7 +59,12 @@ extern void irq_enter(void);
|
||||||
/*
|
/*
|
||||||
* Exit irq context and process softirqs if needed:
|
* Exit irq context and process softirqs if needed:
|
||||||
*/
|
*/
|
||||||
extern void irq_exit(void);
|
void irq_exit(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Like irq_exit(), but return with RCU watching.
|
||||||
|
*/
|
||||||
|
void irq_exit_rcu(void);
|
||||||
|
|
||||||
#ifndef arch_nmi_enter
|
#ifndef arch_nmi_enter
|
||||||
#define arch_nmi_enter() do { } while (0)
|
#define arch_nmi_enter() do { } while (0)
|
||||||
|
|
|
@ -339,12 +339,11 @@ asmlinkage __visible void do_softirq(void)
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Enter an interrupt context.
|
* irq_enter_rcu - Enter an interrupt context with RCU watching
|
||||||
*/
|
*/
|
||||||
void irq_enter(void)
|
void irq_enter_rcu(void)
|
||||||
{
|
{
|
||||||
rcu_irq_enter();
|
|
||||||
if (is_idle_task(current) && !in_interrupt()) {
|
if (is_idle_task(current) && !in_interrupt()) {
|
||||||
/*
|
/*
|
||||||
* Prevent raise_softirq from needlessly waking up ksoftirqd
|
* Prevent raise_softirq from needlessly waking up ksoftirqd
|
||||||
|
@ -354,10 +353,18 @@ void irq_enter(void)
|
||||||
tick_irq_enter();
|
tick_irq_enter();
|
||||||
_local_bh_enable();
|
_local_bh_enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
__irq_enter();
|
__irq_enter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* irq_enter - Enter an interrupt context including RCU update
|
||||||
|
*/
|
||||||
|
void irq_enter(void)
|
||||||
|
{
|
||||||
|
rcu_irq_enter();
|
||||||
|
irq_enter_rcu();
|
||||||
|
}
|
||||||
|
|
||||||
static inline void invoke_softirq(void)
|
static inline void invoke_softirq(void)
|
||||||
{
|
{
|
||||||
if (ksoftirqd_running(local_softirq_pending()))
|
if (ksoftirqd_running(local_softirq_pending()))
|
||||||
|
@ -397,10 +404,12 @@ static inline void tick_irq_exit(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Exit an interrupt context. Process softirqs if needed and possible:
|
* irq_exit_rcu() - Exit an interrupt context without updating RCU
|
||||||
|
*
|
||||||
|
* Also processes softirqs if needed and possible.
|
||||||
*/
|
*/
|
||||||
void irq_exit(void)
|
void irq_exit_rcu(void)
|
||||||
{
|
{
|
||||||
#ifndef __ARCH_IRQ_EXIT_IRQS_DISABLED
|
#ifndef __ARCH_IRQ_EXIT_IRQS_DISABLED
|
||||||
local_irq_disable();
|
local_irq_disable();
|
||||||
|
@ -413,6 +422,16 @@ void irq_exit(void)
|
||||||
invoke_softirq();
|
invoke_softirq();
|
||||||
|
|
||||||
tick_irq_exit();
|
tick_irq_exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* irq_exit - Exit an interrupt context, update RCU and lockdep
|
||||||
|
*
|
||||||
|
* Also processes softirqs if needed and possible.
|
||||||
|
*/
|
||||||
|
void irq_exit(void)
|
||||||
|
{
|
||||||
|
irq_exit_rcu();
|
||||||
rcu_irq_exit();
|
rcu_irq_exit();
|
||||||
/* must be last! */
|
/* must be last! */
|
||||||
lockdep_hardirq_exit();
|
lockdep_hardirq_exit();
|
||||||
|
|
Loading…
Reference in a new issue