Commit 02f50142 authored by Paul E. McKenney's avatar Paul E. McKenney

rcu: Remove rsp parameter from rcu_accelerate_cbs()

There now is only one rcu_state structure in a given build of the
Linux kernel, so there is no need to pass it as a parameter to RCU's
functions.  This commit therefore removes the rsp parameter from
rcu_accelerate_cbs().
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 532c00c9
...@@ -1663,11 +1663,11 @@ static void rcu_gp_kthread_wake(void) ...@@ -1663,11 +1663,11 @@ static void rcu_gp_kthread_wake(void)
* *
* The caller must hold rnp->lock with interrupts disabled. * The caller must hold rnp->lock with interrupts disabled.
*/ */
static bool rcu_accelerate_cbs(struct rcu_state *rsp, struct rcu_node *rnp, static bool rcu_accelerate_cbs(struct rcu_node *rnp, struct rcu_data *rdp)
struct rcu_data *rdp)
{ {
unsigned long gp_seq_req; unsigned long gp_seq_req;
bool ret = false; bool ret = false;
struct rcu_state *rsp = &rcu_state;
raw_lockdep_assert_held_rcu_node(rnp); raw_lockdep_assert_held_rcu_node(rnp);
...@@ -1719,7 +1719,7 @@ static void rcu_accelerate_cbs_unlocked(struct rcu_state *rsp, ...@@ -1719,7 +1719,7 @@ static void rcu_accelerate_cbs_unlocked(struct rcu_state *rsp,
return; return;
} }
raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */ raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */
needwake = rcu_accelerate_cbs(rsp, rnp, rdp); needwake = rcu_accelerate_cbs(rnp, rdp);
raw_spin_unlock_rcu_node(rnp); /* irqs remain disabled. */ raw_spin_unlock_rcu_node(rnp); /* irqs remain disabled. */
if (needwake) if (needwake)
rcu_gp_kthread_wake(); rcu_gp_kthread_wake();
...@@ -1751,7 +1751,7 @@ static bool rcu_advance_cbs(struct rcu_state *rsp, struct rcu_node *rnp, ...@@ -1751,7 +1751,7 @@ static bool rcu_advance_cbs(struct rcu_state *rsp, struct rcu_node *rnp,
rcu_segcblist_advance(&rdp->cblist, rnp->gp_seq); rcu_segcblist_advance(&rdp->cblist, rnp->gp_seq);
/* Classify any remaining callbacks. */ /* Classify any remaining callbacks. */
return rcu_accelerate_cbs(rsp, rnp, rdp); return rcu_accelerate_cbs(rnp, rdp);
} }
/* /*
...@@ -1777,7 +1777,7 @@ static bool __note_gp_changes(struct rcu_state *rsp, struct rcu_node *rnp, ...@@ -1777,7 +1777,7 @@ static bool __note_gp_changes(struct rcu_state *rsp, struct rcu_node *rnp,
ret = rcu_advance_cbs(rsp, rnp, rdp); /* Advance callbacks. */ ret = rcu_advance_cbs(rsp, rnp, rdp); /* Advance callbacks. */
trace_rcu_grace_period(rsp->name, rdp->gp_seq, TPS("cpuend")); trace_rcu_grace_period(rsp->name, rdp->gp_seq, TPS("cpuend"));
} else { } else {
ret = rcu_accelerate_cbs(rsp, rnp, rdp); /* Recent callbacks. */ ret = rcu_accelerate_cbs(rnp, rdp); /* Recent callbacks. */
} }
/* Now handle the beginnings of any new-to-this-CPU grace periods. */ /* Now handle the beginnings of any new-to-this-CPU grace periods. */
...@@ -2078,7 +2078,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp) ...@@ -2078,7 +2078,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
needgp = true; needgp = true;
} }
/* Advance CBs to reduce false positives below. */ /* Advance CBs to reduce false positives below. */
if (!rcu_accelerate_cbs(rsp, rnp, rdp) && needgp) { if (!rcu_accelerate_cbs(rnp, rdp) && needgp) {
WRITE_ONCE(rsp->gp_flags, RCU_GP_FLAG_INIT); WRITE_ONCE(rsp->gp_flags, RCU_GP_FLAG_INIT);
rsp->gp_req_activity = jiffies; rsp->gp_req_activity = jiffies;
trace_rcu_grace_period(rsp->name, READ_ONCE(rsp->gp_seq), trace_rcu_grace_period(rsp->name, READ_ONCE(rsp->gp_seq),
...@@ -2331,7 +2331,6 @@ rcu_report_qs_rdp(int cpu, struct rcu_data *rdp) ...@@ -2331,7 +2331,6 @@ rcu_report_qs_rdp(int cpu, struct rcu_data *rdp)
unsigned long mask; unsigned long mask;
bool needwake; bool needwake;
struct rcu_node *rnp; struct rcu_node *rnp;
struct rcu_state *rsp = &rcu_state;
rnp = rdp->mynode; rnp = rdp->mynode;
raw_spin_lock_irqsave_rcu_node(rnp, flags); raw_spin_lock_irqsave_rcu_node(rnp, flags);
...@@ -2359,7 +2358,7 @@ rcu_report_qs_rdp(int cpu, struct rcu_data *rdp) ...@@ -2359,7 +2358,7 @@ rcu_report_qs_rdp(int cpu, struct rcu_data *rdp)
* This GP can't end until cpu checks in, so all of our * This GP can't end until cpu checks in, so all of our
* callbacks can be processed during the next GP. * callbacks can be processed during the next GP.
*/ */
needwake = rcu_accelerate_cbs(rsp, rnp, rdp); needwake = rcu_accelerate_cbs(rnp, rdp);
rcu_report_qs_rnp(mask, rnp, rnp->gp_seq, flags); rcu_report_qs_rnp(mask, rnp, rnp->gp_seq, flags);
/* ^^^ Released rnp->lock */ /* ^^^ Released rnp->lock */
......
...@@ -1697,7 +1697,7 @@ static void rcu_prepare_for_idle(void) ...@@ -1697,7 +1697,7 @@ static void rcu_prepare_for_idle(void)
continue; continue;
rnp = rdp->mynode; rnp = rdp->mynode;
raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */ raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */
needwake = rcu_accelerate_cbs(rsp, rnp, rdp); needwake = rcu_accelerate_cbs(rnp, rdp);
raw_spin_unlock_rcu_node(rnp); /* irqs remain disabled. */ raw_spin_unlock_rcu_node(rnp); /* irqs remain disabled. */
if (needwake) if (needwake)
rcu_gp_kthread_wake(); rcu_gp_kthread_wake();
......
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