[tip:core/rcu] rcu: Merge per-RCU-flavor initialization into pre-existing macro

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: tip-bot for Paul E. McKenney
Date: Sunday, August 23, 2009 - 2:02 am

Commit-ID:  65cf8f866fc0fb40fa9daaded7e938a886d6f7c5
Gitweb:     http://git.kernel.org/tip/65cf8f866fc0fb40fa9daaded7e938a886d6f7c5
Author:     Paul E. McKenney <paulmck@linux.vnet.ibm.com>
AuthorDate: Sat, 22 Aug 2009 13:56:49 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 23 Aug 2009 10:32:38 +0200

rcu: Merge per-RCU-flavor initialization into pre-existing macro

Rename the RCU_DATA_PTR_INIT() macro to RCU_INIT_FLAVOR() and
make it do the rcu_init_one() and rcu_boot_init_percpu_data()
calls.  Merge the loop that was in the original macro with the
loops that were in __rcu_init().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: akpm@linux-foundation.org
Cc: mathieu.desnoyers@polymtl.ca
Cc: josht@linux.vnet.ibm.com
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
LKML-Reference: <12509746133916-git-send-email->
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 kernel/rcutree.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 4d71d4e..7c51508 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1543,8 +1543,9 @@ static void __init rcu_init_one(struct rcu_state *rsp)
  * Helper macro for __rcu_init().  To be used nowhere else!
  * Assigns leaf node pointers into each CPU's rcu_data structure.
  */
-#define RCU_DATA_PTR_INIT(rsp, rcu_data) \
+#define RCU_INIT_FLAVOR(rsp, rcu_data) \
 do { \
+	rcu_init_one(rsp); \
 	rnp = (rsp)->level[NUM_RCU_LVLS - 1]; \
 	j = 0; \
 	for_each_possible_cpu(i) { \
@@ -1552,6 +1553,7 @@ do { \
 			j++; \
 		per_cpu(rcu_data, i).mynode = &rnp[j]; \
 		(rsp)->rda[i] = &per_cpu(rcu_data, i); \
+		rcu_boot_init_percpu_data(i, rsp); \
 	} \
 } while (0)
 
@@ -1565,14 +1567,8 @@ void __init __rcu_init(void)
 #ifdef CONFIG_RCU_CPU_STALL_DETECTOR
 	printk(KERN_INFO "RCU-based detection of stalled CPUs is enabled.\n");
 #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */
-	rcu_init_one(&rcu_sched_state);
-	RCU_DATA_PTR_INIT(&rcu_sched_state, rcu_sched_data);
-	for_each_possible_cpu(i)
-		rcu_boot_init_percpu_data(i, &rcu_sched_state);
-	rcu_init_one(&rcu_bh_state);
-	RCU_DATA_PTR_INIT(&rcu_bh_state, rcu_bh_data);
-	for_each_possible_cpu(i)
-		rcu_boot_init_percpu_data(i, &rcu_bh_state);
+	RCU_INIT_FLAVOR(&rcu_sched_state, rcu_sched_data);
+	RCU_INIT_FLAVOR(&rcu_bh_state, rcu_bh_data);
 	open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH RFC -tip 0/4] v2 RCU cleanups and simplified preemp ..., Paul E. McKenney, (Mon Jul 27, 11:14 am)
[PATCH RFC -tip 1/4] v2 Move private definitions from incl ..., Paul E. McKenney, (Mon Jul 27, 11:16 am)
[PATCH RFC -tip 2/4] v2 Renamings to increase RCU clarity., Paul E. McKenney, (Mon Jul 27, 11:16 am)
[PATCH RFC -tip 3/4] v2 Consolidate sparse and lockdep dec ..., Paul E. McKenney, (Mon Jul 27, 11:16 am)
[PATCH RFC -tip 4/4] v2 Merge preemptable-RCU functionalit ..., Paul E. McKenney, (Mon Jul 27, 11:16 am)
[PATCH -tip] v3 Renamings to increase RCU clarity., Paul E. McKenney, (Sat Aug 22, 1:56 pm)
[PATCH -tip] v3 Use debugfs_remove_recursive() simplify code., Paul E. McKenney, (Sat Aug 22, 1:56 pm)
[PATCH -tip] v3 Remove CONFIG_PREEMPT_RCU, Paul E. McKenney, (Sat Aug 22, 1:56 pm)
[tip:core/rcu] rcu: Move private definitions from include/ ..., tip-bot for Paul E. ..., (Sun Aug 23, 2:01 am)
[tip:core/rcu] rcu: Renamings to increase RCU clarity, tip-bot for Paul E. ..., (Sun Aug 23, 2:01 am)
[tip:core/rcu] rcu: Consolidate sparse and lockdep declara ..., tip-bot for Paul E. ..., (Sun Aug 23, 2:02 am)
[tip:core/rcu] rcu: Fix online/offline indication for rcud ..., tip-bot for Paul E. ..., (Sun Aug 23, 2:02 am)
[tip:core/rcu] rcu: Merge per-RCU-flavor initialization in ..., tip-bot for Paul E. ..., (Sun Aug 23, 2:02 am)
[tip:core/rcu] rcu: Use debugfs_remove_recursive() simplif ..., tip-bot for Paul E. ..., (Sun Aug 23, 2:02 am)
[tip:core/rcu] rcu: Simplify rcu_pending()/rcu_check_callb ..., tip-bot for Paul E. ..., (Sun Aug 23, 2:02 am)
[tip:core/rcu] rcu: Merge preemptable-RCU functionality in ..., tip-bot for Paul E. ..., (Sun Aug 23, 2:03 am)
[tip:core/rcu] rcu: Remove CONFIG_PREEMPT_RCU, tip-bot for Paul E. ..., (Sun Aug 23, 2:03 am)
Re: [tip:core/rcu] rcu: Consolidate sparse and lockdep dec ..., Paul E. McKenney, (Sun Aug 23, 12:33 pm)
Re: [PATCH -tip] v3 Renamings to increase RCU clarity., Lai Jiangshan, (Mon Aug 24, 12:17 am)
Re: [PATCH -tip] v3 Renamings to increase RCU clarity., Paul E. McKenney, (Mon Aug 24, 8:36 am)