Commit 1089c007 authored by Valentin Schneider's avatar Valentin Schneider Committed by Neeraj Upadhyay

context_tracking, rcu: Rename ct_dynticks_nesting() into ct_nesting()

The context_tracking.state RCU_DYNTICKS subvariable has been renamed to
RCU_WATCHING, reflect that change in the related helpers.
Suggested-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Signed-off-by: default avatarValentin Schneider <vschneid@redhat.com>
Reviewed-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Signed-off-by: default avatarNeeraj Upadhyay <neeraj.upadhyay@kernel.org>
parent bf664719
...@@ -75,7 +75,7 @@ static __always_inline int ct_rcu_watching_cpu_acquire(int cpu) ...@@ -75,7 +75,7 @@ static __always_inline int ct_rcu_watching_cpu_acquire(int cpu)
return atomic_read_acquire(&ct->state) & CT_RCU_WATCHING_MASK; return atomic_read_acquire(&ct->state) & CT_RCU_WATCHING_MASK;
} }
static __always_inline long ct_dynticks_nesting(void) static __always_inline long ct_nesting(void)
{ {
return __this_cpu_read(context_tracking.nesting); return __this_cpu_read(context_tracking.nesting);
} }
......
...@@ -128,8 +128,8 @@ static void noinstr ct_kernel_exit(bool user, int offset) ...@@ -128,8 +128,8 @@ static void noinstr ct_kernel_exit(bool user, int offset)
WARN_ON_ONCE(ct_dynticks_nmi_nesting() != DYNTICK_IRQ_NONIDLE); WARN_ON_ONCE(ct_dynticks_nmi_nesting() != DYNTICK_IRQ_NONIDLE);
WRITE_ONCE(ct->dynticks_nmi_nesting, 0); WRITE_ONCE(ct->dynticks_nmi_nesting, 0);
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
ct_dynticks_nesting() == 0); ct_nesting() == 0);
if (ct_dynticks_nesting() != 1) { if (ct_nesting() != 1) {
// RCU will still be watching, so just do accounting and leave. // RCU will still be watching, so just do accounting and leave.
ct->nesting--; ct->nesting--;
return; return;
...@@ -137,7 +137,7 @@ static void noinstr ct_kernel_exit(bool user, int offset) ...@@ -137,7 +137,7 @@ static void noinstr ct_kernel_exit(bool user, int offset)
instrumentation_begin(); instrumentation_begin();
lockdep_assert_irqs_disabled(); lockdep_assert_irqs_disabled();
trace_rcu_dyntick(TPS("Start"), ct_dynticks_nesting(), 0, ct_rcu_watching()); trace_rcu_dyntick(TPS("Start"), ct_nesting(), 0, ct_rcu_watching());
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !user && !is_idle_task(current)); WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !user && !is_idle_task(current));
rcu_preempt_deferred_qs(current); rcu_preempt_deferred_qs(current);
...@@ -166,7 +166,7 @@ static void noinstr ct_kernel_enter(bool user, int offset) ...@@ -166,7 +166,7 @@ static void noinstr ct_kernel_enter(bool user, int offset)
long oldval; long oldval;
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !raw_irqs_disabled()); WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !raw_irqs_disabled());
oldval = ct_dynticks_nesting(); oldval = ct_nesting();
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && oldval < 0); WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && oldval < 0);
if (oldval) { if (oldval) {
// RCU was already watching, so just do accounting and leave. // RCU was already watching, so just do accounting and leave.
...@@ -182,7 +182,7 @@ static void noinstr ct_kernel_enter(bool user, int offset) ...@@ -182,7 +182,7 @@ static void noinstr ct_kernel_enter(bool user, int offset)
// instrumentation for the noinstr ct_kernel_enter_state() // instrumentation for the noinstr ct_kernel_enter_state()
instrument_atomic_write(&ct->state, sizeof(ct->state)); instrument_atomic_write(&ct->state, sizeof(ct->state));
trace_rcu_dyntick(TPS("End"), ct_dynticks_nesting(), 1, ct_rcu_watching()); trace_rcu_dyntick(TPS("End"), ct_nesting(), 1, ct_rcu_watching());
WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !user && !is_idle_task(current)); WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) && !user && !is_idle_task(current));
WRITE_ONCE(ct->nesting, 1); WRITE_ONCE(ct->nesting, 1);
WARN_ON_ONCE(ct_dynticks_nmi_nesting()); WARN_ON_ONCE(ct_dynticks_nmi_nesting());
......
...@@ -388,7 +388,7 @@ static int rcu_is_cpu_rrupt_from_idle(void) ...@@ -388,7 +388,7 @@ static int rcu_is_cpu_rrupt_from_idle(void)
lockdep_assert_irqs_disabled(); lockdep_assert_irqs_disabled();
/* Check for counter underflows */ /* Check for counter underflows */
RCU_LOCKDEP_WARN(ct_dynticks_nesting() < 0, RCU_LOCKDEP_WARN(ct_nesting() < 0,
"RCU nesting counter underflow!"); "RCU nesting counter underflow!");
RCU_LOCKDEP_WARN(ct_dynticks_nmi_nesting() <= 0, RCU_LOCKDEP_WARN(ct_dynticks_nmi_nesting() <= 0,
"RCU dynticks_nmi_nesting counter underflow/zero!"); "RCU dynticks_nmi_nesting counter underflow/zero!");
...@@ -404,7 +404,7 @@ static int rcu_is_cpu_rrupt_from_idle(void) ...@@ -404,7 +404,7 @@ static int rcu_is_cpu_rrupt_from_idle(void)
WARN_ON_ONCE(!nesting && !is_idle_task(current)); WARN_ON_ONCE(!nesting && !is_idle_task(current));
/* Does CPU appear to be idle from an RCU standpoint? */ /* Does CPU appear to be idle from an RCU standpoint? */
return ct_dynticks_nesting() == 0; return ct_nesting() == 0;
} }
#define DEFAULT_RCU_BLIMIT (IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) ? 1000 : 10) #define DEFAULT_RCU_BLIMIT (IS_ENABLED(CONFIG_RCU_STRICT_GRACE_PERIOD) ? 1000 : 10)
...@@ -596,7 +596,7 @@ void rcu_irq_exit_check_preempt(void) ...@@ -596,7 +596,7 @@ void rcu_irq_exit_check_preempt(void)
{ {
lockdep_assert_irqs_disabled(); lockdep_assert_irqs_disabled();
RCU_LOCKDEP_WARN(ct_dynticks_nesting() <= 0, RCU_LOCKDEP_WARN(ct_nesting() <= 0,
"RCU nesting counter underflow/zero!"); "RCU nesting counter underflow/zero!");
RCU_LOCKDEP_WARN(ct_dynticks_nmi_nesting() != RCU_LOCKDEP_WARN(ct_dynticks_nmi_nesting() !=
DYNTICK_IRQ_NONIDLE, DYNTICK_IRQ_NONIDLE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment