linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH tip/core/rcu 38/52] rcu: Remove rsp parameter from no-CBs CPU functions
Date: Wed, 29 Aug 2018 15:38:40 -0700	[thread overview]
Message-ID: <20180829223854.4055-38-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180829223830.GA1800@linux.vnet.ibm.com>

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_nocb_cpu_needs_barrier(), rcu_spawn_one_nocb_kthread(),
rcu_organize_nocb_kthreads(), rcu_nocb_cpu_needs_barrier(), and
rcu_nohz_full_cpu().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcu/tree.c        |  4 ++--
 kernel/rcu/tree.h        |  6 +++---
 kernel/rcu/tree_plugin.h | 18 +++++++++---------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 1b63a28f148d..6d8e4a4d8019 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3094,7 +3094,7 @@ static int rcu_pending(void)
 	check_cpu_stall(rdp);
 
 	/* Is this CPU a NO_HZ_FULL CPU that should ignore RCU? */
-	if (rcu_nohz_full_cpu(&rcu_state))
+	if (rcu_nohz_full_cpu())
 		return 0;
 
 	/* Is the RCU core waiting for a quiescent state from this CPU? */
@@ -3245,7 +3245,7 @@ static void _rcu_barrier(void)
 			continue;
 		rdp = per_cpu_ptr(&rcu_data, cpu);
 		if (rcu_is_nocb_cpu(cpu)) {
-			if (!rcu_nocb_cpu_needs_barrier(rsp, cpu)) {
+			if (!rcu_nocb_cpu_needs_barrier(cpu)) {
 				_rcu_barrier_trace(TPS("OfflineNoCB"), cpu,
 						   rsp->barrier_sequence);
 			} else {
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index 2bf57de9f78a..7c6033d71e9d 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -476,7 +476,7 @@ static void print_cpu_stall_info(int cpu);
 static void print_cpu_stall_info_end(void);
 static void zero_cpu_stall_ticks(struct rcu_data *rdp);
 static void increment_cpu_stall_ticks(void);
-static bool rcu_nocb_cpu_needs_barrier(struct rcu_state *rsp, int cpu);
+static bool rcu_nocb_cpu_needs_barrier(int cpu);
 static struct swait_queue_head *rcu_nocb_gp_get(struct rcu_node *rnp);
 static void rcu_nocb_gp_cleanup(struct swait_queue_head *sq);
 static void rcu_init_one_nocb(struct rcu_node *rnp);
@@ -491,11 +491,11 @@ static void rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp);
 static void rcu_spawn_all_nocb_kthreads(int cpu);
 static void __init rcu_spawn_nocb_kthreads(void);
 #ifdef CONFIG_RCU_NOCB_CPU
-static void __init rcu_organize_nocb_kthreads(struct rcu_state *rsp);
+static void __init rcu_organize_nocb_kthreads(void);
 #endif /* #ifdef CONFIG_RCU_NOCB_CPU */
 static bool init_nocb_callback_list(struct rcu_data *rdp);
 static void rcu_bind_gp_kthread(void);
-static bool rcu_nohz_full_cpu(struct rcu_state *rsp);
+static bool rcu_nohz_full_cpu(void);
 static void rcu_dynticks_task_enter(void);
 static void rcu_dynticks_task_exit(void);
 
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 08ff162e02b3..69705ec13527 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1960,7 +1960,7 @@ static void wake_nocb_leader_defer(struct rcu_data *rdp, int waketype,
  * Does the specified CPU need an RCU callback for the specified flavor
  * of rcu_barrier()?
  */
-static bool rcu_nocb_cpu_needs_barrier(struct rcu_state *rsp, int cpu)
+static bool rcu_nocb_cpu_needs_barrier(int cpu)
 {
 	struct rcu_data *rdp = per_cpu_ptr(&rcu_data, cpu);
 	unsigned long ret;
@@ -2424,7 +2424,7 @@ void __init rcu_init_nohz(void)
 	for_each_rcu_flavor(rsp) {
 		for_each_cpu(cpu, rcu_nocb_mask)
 			init_nocb_callback_list(per_cpu_ptr(&rcu_data, cpu));
-		rcu_organize_nocb_kthreads(rsp);
+		rcu_organize_nocb_kthreads();
 	}
 }
 
@@ -2444,7 +2444,7 @@ static void __init rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp)
  * brought online out of order, this can require re-organizing the
  * leader-follower relationships.
  */
-static void rcu_spawn_one_nocb_kthread(struct rcu_state *rsp, int cpu)
+static void rcu_spawn_one_nocb_kthread(int cpu)
 {
 	struct rcu_data *rdp;
 	struct rcu_data *rdp_last;
@@ -2481,7 +2481,7 @@ static void rcu_spawn_one_nocb_kthread(struct rcu_state *rsp, int cpu)
 
 	/* Spawn the kthread for this CPU and RCU flavor. */
 	t = kthread_run(rcu_nocb_kthread, rdp_spawn,
-			"rcuo%c/%d", rsp->abbr, cpu);
+			"rcuo%c/%d", rcu_state.abbr, cpu);
 	BUG_ON(IS_ERR(t));
 	WRITE_ONCE(rdp_spawn->nocb_kthread, t);
 }
@@ -2496,7 +2496,7 @@ static void rcu_spawn_all_nocb_kthreads(int cpu)
 
 	if (rcu_scheduler_fully_active)
 		for_each_rcu_flavor(rsp)
-			rcu_spawn_one_nocb_kthread(rsp, cpu);
+			rcu_spawn_one_nocb_kthread(cpu);
 }
 
 /*
@@ -2520,7 +2520,7 @@ module_param(rcu_nocb_leader_stride, int, 0444);
 /*
  * Initialize leader-follower relationships for all no-CBs CPU.
  */
-static void __init rcu_organize_nocb_kthreads(struct rcu_state *rsp)
+static void __init rcu_organize_nocb_kthreads(void)
 {
 	int cpu;
 	int ls = rcu_nocb_leader_stride;
@@ -2579,7 +2579,7 @@ static bool init_nocb_callback_list(struct rcu_data *rdp)
 
 #else /* #ifdef CONFIG_RCU_NOCB_CPU */
 
-static bool rcu_nocb_cpu_needs_barrier(struct rcu_state *rsp, int cpu)
+static bool rcu_nocb_cpu_needs_barrier(int cpu)
 {
 	WARN_ON_ONCE(1); /* Should be dead code. */
 	return false;
@@ -2648,12 +2648,12 @@ static bool init_nocb_callback_list(struct rcu_data *rdp)
  * This code relies on the fact that all NO_HZ_FULL CPUs are also
  * CONFIG_RCU_NOCB_CPU CPUs.
  */
-static bool rcu_nohz_full_cpu(struct rcu_state *rsp)
+static bool rcu_nohz_full_cpu(void)
 {
 #ifdef CONFIG_NO_HZ_FULL
 	if (tick_nohz_full_cpu(smp_processor_id()) &&
 	    (!rcu_gp_in_progress() ||
-	     ULONG_CMP_LT(jiffies, READ_ONCE(rsp->gp_start) + HZ)))
+	     ULONG_CMP_LT(jiffies, READ_ONCE(rcu_state.gp_start) + HZ)))
 		return true;
 #endif /* #ifdef CONFIG_NO_HZ_FULL */
 	return false;
-- 
2.17.1


  parent reply	other threads:[~2018-08-29 22:41 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29 22:38 [PATCH tip/core/rcu 0/52] Remove rcu_state pointers for v4.20/v5.0 Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 01/52] rcu: Remove rsp parameter from rcu_report_qs_rnp() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 02/52] rcu: Remove rsp parameter from rcu_report_qs_rsp() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 03/52] rcu: Remove rsp parameter from rcu_report_unblock_qs_rnp() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 04/52] rcu: Remove rsp parameter from rcu_report_qs_rdp() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 05/52] rcu: Remove rsp parameter from rcu_gp_in_progress() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 06/52] rcu: Remove rsp parameter from rcu_get_root() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 07/52] rcu: Remove rsp parameter from record_gp_stall_check_time() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 08/52] rcu: Remove rsp parameter from rcu_check_gp_kthread_starvation() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 09/52] rcu: Remove rsp parameter from rcu_dump_cpu_stacks() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 10/52] rcu: Remove rsp parameter from rcu_stall_kick_kthreads() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 11/52] rcu: Remove rsp parameter from print_other_cpu_stall() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 12/52] rcu: Remove rsp parameter from print_cpu_stall() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 13/52] rcu: Remove rsp parameter from check_cpu_stall() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 14/52] rcu: Remove rsp parameter from rcu_future_gp_cleanup() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 15/52] rcu: Remove rsp parameter from rcu_gp_kthread_wake() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 16/52] rcu: Remove rsp parameter from rcu_accelerate_cbs() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 17/52] rcu: Remove rsp parameter from rcu_accelerate_cbs_unlocked() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 18/52] rcu: Remove rsp parameter from rcu_advance_cbs() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 19/52] rcu: Remove rsp parameter from __note_gp_changes() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 20/52] rcu: Remove rsp parameter from note_gp_changes() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 21/52] rcu: Remove rsp parameter from rcu_gp_slow() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 22/52] rcu: Remove rsp parameter from rcu_gp_kthread() and friends Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 23/52] rcu: Remove rsp parameter from rcu_check_quiescent_state() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 24/52] rcu: Remove rsp parameter from CPU hotplug functions Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 25/52] rcu: Remove rsp parameter from rcu_do_batch() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 26/52] rcu: Remove rsp parameter from force-quiescent-state functions Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 27/52] rcu: Remove rsp parameter from rcu_check_gp_start_stall() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 28/52] rcu: Remove rsp parameter from __rcu_process_callbacks() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 29/52] rcu: Remove rsp parameter from __call_rcu() and friend Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 30/52] rcu: Remove rsp parameter from __rcu_pending() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 31/52] rcu: Remove rsp parameter from _rcu_barrier() and friends Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 32/52] rcu: Remove rsp parameter from rcu_boot_init_percpu_data() " Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 33/52] rcu: Remove rsp parameter from rcu_init_one() " Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 34/52] rcu: Remove rsp parameter from rcu_print_detail_task_stall() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 35/52] rcu: Remove rsp parameter from dump_blkd_tasks() and friend Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 36/52] rcu: Remove rsp parameter from rcu_spawn_one_boost_kthread() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 37/52] rcu: Remove rsp parameter from print_cpu_stall_info() Paul E. McKenney
2018-08-29 22:38 ` Paul E. McKenney [this message]
2018-08-29 22:38 ` [PATCH tip/core/rcu 39/52] rcu: Remove rsp parameter from expedited grace-period functions Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 40/52] rcu: Remove rsp parameter from rcu_node tree accessor macros Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 41/52] rcu: Remove rcu_data structure's ->rsp field Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 42/52] rcu: Remove last non-flavor-traversal rsp local variable from tree_plugin.h Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 43/52] rcu: Remove for_each_rcu_flavor() flavor-traversal macro Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 44/52] rcu: Simplify rcutorture_get_gp_data() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 45/52] rcu: Restructure rcu_check_gp_kthread_starvation() Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 46/52] rcu: Eliminate stall-warning use of rsp Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 47/52] rcu: Eliminate grace-period management code " Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 48/52] rcu: Eliminate callback-invocation/invocation " Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 49/52] rcu: Eliminate quiescent-state and grace-period-nonstart " Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 50/52] rcu: Eliminate RCU-barrier " Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 51/52] rcu: Eliminate initialization-time " Paul E. McKenney
2018-08-29 22:38 ` [PATCH tip/core/rcu 52/52] rcu: Fix typo in force_qs_rnp()'s parameter's parameter Paul E. McKenney
2018-08-30  2:00 ` [PATCH tip/core/rcu 0/52] Remove rcu_state pointers for v4.20/v5.0 Steven Rostedt
2018-08-30  3:22   ` Paul E. McKenney
2018-08-30  4:10     ` Paul E. McKenney
2018-08-30  4:20       ` Josh Triplett
2018-08-30 15:42         ` Steven Rostedt
2018-08-30 15:44       ` Steven Rostedt
2018-08-30 17:10         ` Paul E. McKenney
2018-08-30 17:40           ` Steven Rostedt
2018-08-30 18:26             ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180829223854.4055-38-paulmck@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).