提交 6136d6e4 编写于 作者: P Paul E. McKenney

rcu: Clamp ->dynticks_nmi_nesting at eqs entry/exit

In preparation for merging dyntick-idle irq handling into the NMI
algorithm, clamp ->dynticks_nmi_nesting value to allow for interrupts
that enter but never leave and vice versa.

It is important that the clamping happen outside of the extended quiescent
state.  Otherwise, there will be short windows where irqs and NMIs fail
to convince RCU to start watching.
Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
上级 fd581a91
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
#define DYNTICK_TASK_EXIT_IDLE (DYNTICK_TASK_NEST_VALUE + \ #define DYNTICK_TASK_EXIT_IDLE (DYNTICK_TASK_NEST_VALUE + \
DYNTICK_TASK_FLAG) DYNTICK_TASK_FLAG)
#define DYNTICK_IRQ_NONIDLE ((INT_MAX / 2) + 1)
/* /*
* Grace-period counter management. * Grace-period counter management.
......
...@@ -818,6 +818,7 @@ static void rcu_eqs_enter(bool user) ...@@ -818,6 +818,7 @@ static void rcu_eqs_enter(bool user)
struct rcu_dynticks *rdtp; struct rcu_dynticks *rdtp;
rdtp = this_cpu_ptr(&rcu_dynticks); rdtp = this_cpu_ptr(&rcu_dynticks);
WRITE_ONCE(rdtp->dynticks_nmi_nesting, 0);
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
(rdtp->dynticks_nesting & DYNTICK_TASK_NEST_MASK) == 0); (rdtp->dynticks_nesting & DYNTICK_TASK_NEST_MASK) == 0);
if ((rdtp->dynticks_nesting & DYNTICK_TASK_NEST_MASK) == DYNTICK_TASK_NEST_VALUE) if ((rdtp->dynticks_nesting & DYNTICK_TASK_NEST_MASK) == DYNTICK_TASK_NEST_VALUE)
...@@ -1008,6 +1009,7 @@ static void rcu_eqs_exit(bool user) ...@@ -1008,6 +1009,7 @@ static void rcu_eqs_exit(bool user)
rcu_eqs_exit_common(DYNTICK_TASK_EXIT_IDLE, user); rcu_eqs_exit_common(DYNTICK_TASK_EXIT_IDLE, user);
rdtp->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE; rdtp->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE;
__this_cpu_dec(disable_rcu_irq_enter); __this_cpu_dec(disable_rcu_irq_enter);
WRITE_ONCE(rdtp->dynticks_nmi_nesting, DYNTICK_IRQ_NONIDLE);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册