aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2010-03-27 23:12:30 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2010-05-10 14:08:31 -0400
commit0c34029abdfdea64420cb4264c4e91a776b22157 (patch)
tree9025ccfef4210c04520617a4ae11ec4f24128660 /kernel
parentf261414f0d56dd1a0e34888e27d1d4902ad052f3 (diff)
rcu: move some code from macro to function
Shrink the RCU_INIT_FLAVOR() macro by moving all but the initialization of the ->rda[] array to rcu_init_one(). The call to rcu_init_one() can then be moved to the end of the RCU_INIT_FLAVOR() macro, which is required because rcu_boot_init_percpu_data(), which is now called from rcu_init_one(), depends on the initialization of the ->rda[] array. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcutree.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 6042fb859535..86bb9499aae6 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1859,6 +1859,14 @@ static void __init rcu_init_one(struct rcu_state *rsp)
1859 INIT_LIST_HEAD(&rnp->blocked_tasks[3]); 1859 INIT_LIST_HEAD(&rnp->blocked_tasks[3]);
1860 } 1860 }
1861 } 1861 }
1862
1863 rnp = rsp->level[NUM_RCU_LVLS - 1];
1864 for_each_possible_cpu(i) {
1865 if (i > rnp->grphi)
1866 rnp++;
1867 rsp->rda[i]->mynode = rnp;
1868 rcu_boot_init_percpu_data(i, rsp);
1869 }
1862} 1870}
1863 1871
1864/* 1872/*
@@ -1869,19 +1877,11 @@ static void __init rcu_init_one(struct rcu_state *rsp)
1869#define RCU_INIT_FLAVOR(rsp, rcu_data) \ 1877#define RCU_INIT_FLAVOR(rsp, rcu_data) \
1870do { \ 1878do { \
1871 int i; \ 1879 int i; \
1872 int j; \
1873 struct rcu_node *rnp; \
1874 \ 1880 \
1875 rcu_init_one(rsp); \
1876 rnp = (rsp)->level[NUM_RCU_LVLS - 1]; \
1877 j = 0; \
1878 for_each_possible_cpu(i) { \ 1881 for_each_possible_cpu(i) { \
1879 if (i > rnp[j].grphi) \
1880 j++; \
1881 per_cpu(rcu_data, i).mynode = &rnp[j]; \
1882 (rsp)->rda[i] = &per_cpu(rcu_data, i); \ 1882 (rsp)->rda[i] = &per_cpu(rcu_data, i); \
1883 rcu_boot_init_percpu_data(i, rsp); \
1884 } \ 1883 } \
1884 rcu_init_one(rsp); \
1885} while (0) 1885} while (0)
1886 1886
1887void __init rcu_init(void) 1887void __init rcu_init(void)