diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-10-26 02:55:55 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-26 04:40:40 -0400 |
commit | 4ce5b90340879ce93d169b7b523c2cbbe7c45843 (patch) | |
tree | 1372672a37f331a49c3825876a4c3e71ad2df3a0 /kernel/rcutiny.c | |
parent | cf886c44ec418a01b2c52493465accb81acbf930 (diff) |
rcu: Do tiny cleanups in rcutiny
No change in functionality - just straighten out a few small
stylistic details.
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: mathieu.desnoyers@polymtl.ca
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
Cc: Valdis.Kletnieks@vt.edu
Cc: avi@redhat.com
Cc: mtosatti@redhat.com
LKML-Reference: <12565226351355-git-send-email->
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/rcutiny.c')
-rw-r--r-- | kernel/rcutiny.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c index 0b54efde66ac..b33ec3aa377a 100644 --- a/kernel/rcutiny.c +++ b/kernel/rcutiny.c | |||
@@ -20,22 +20,21 @@ | |||
20 | * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 20 | * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> |
21 | * | 21 | * |
22 | * For detailed explanation of Read-Copy Update mechanism see - | 22 | * For detailed explanation of Read-Copy Update mechanism see - |
23 | * Documentation/RCU | 23 | * Documentation/RCU |
24 | */ | 24 | */ |
25 | |||
26 | #include <linux/types.h> | ||
27 | #include <linux/kernel.h> | ||
28 | #include <linux/init.h> | ||
29 | #include <linux/rcupdate.h> | ||
30 | #include <linux/interrupt.h> | ||
31 | #include <linux/sched.h> | ||
32 | #include <linux/module.h> | ||
33 | #include <linux/completion.h> | ||
34 | #include <linux/moduleparam.h> | 25 | #include <linux/moduleparam.h> |
26 | #include <linux/completion.h> | ||
27 | #include <linux/interrupt.h> | ||
35 | #include <linux/notifier.h> | 28 | #include <linux/notifier.h> |
36 | #include <linux/cpu.h> | 29 | #include <linux/rcupdate.h> |
30 | #include <linux/kernel.h> | ||
31 | #include <linux/module.h> | ||
37 | #include <linux/mutex.h> | 32 | #include <linux/mutex.h> |
33 | #include <linux/sched.h> | ||
34 | #include <linux/types.h> | ||
35 | #include <linux/init.h> | ||
38 | #include <linux/time.h> | 36 | #include <linux/time.h> |
37 | #include <linux/cpu.h> | ||
39 | 38 | ||
40 | /* Global control variables for rcupdate callback mechanism. */ | 39 | /* Global control variables for rcupdate callback mechanism. */ |
41 | struct rcu_ctrlblk { | 40 | struct rcu_ctrlblk { |
@@ -46,14 +45,13 @@ struct rcu_ctrlblk { | |||
46 | 45 | ||
47 | /* Definition for rcupdate control block. */ | 46 | /* Definition for rcupdate control block. */ |
48 | static struct rcu_ctrlblk rcu_ctrlblk = { | 47 | static struct rcu_ctrlblk rcu_ctrlblk = { |
49 | .rcucblist = NULL, | 48 | .donetail = &rcu_ctrlblk.rcucblist, |
50 | .donetail = &rcu_ctrlblk.rcucblist, | 49 | .curtail = &rcu_ctrlblk.rcucblist, |
51 | .curtail = &rcu_ctrlblk.rcucblist, | ||
52 | }; | 50 | }; |
51 | |||
53 | static struct rcu_ctrlblk rcu_bh_ctrlblk = { | 52 | static struct rcu_ctrlblk rcu_bh_ctrlblk = { |
54 | .rcucblist = NULL, | 53 | .donetail = &rcu_bh_ctrlblk.rcucblist, |
55 | .donetail = &rcu_bh_ctrlblk.rcucblist, | 54 | .curtail = &rcu_bh_ctrlblk.rcucblist, |
56 | .curtail = &rcu_bh_ctrlblk.rcucblist, | ||
57 | }; | 55 | }; |
58 | 56 | ||
59 | #ifdef CONFIG_NO_HZ | 57 | #ifdef CONFIG_NO_HZ |
@@ -84,8 +82,8 @@ void rcu_exit_nohz(void) | |||
84 | 82 | ||
85 | /* | 83 | /* |
86 | * Helper function for rcu_qsctr_inc() and rcu_bh_qsctr_inc(). | 84 | * Helper function for rcu_qsctr_inc() and rcu_bh_qsctr_inc(). |
87 | * Also disable irqs to avoid confusion due to interrupt handlers invoking | 85 | * Also disable irqs to avoid confusion due to interrupt handlers |
88 | * call_rcu(). | 86 | * invoking call_rcu(). |
89 | */ | 87 | */ |
90 | static int rcu_qsctr_help(struct rcu_ctrlblk *rcp) | 88 | static int rcu_qsctr_help(struct rcu_ctrlblk *rcp) |
91 | { | 89 | { |
@@ -99,6 +97,7 @@ static int rcu_qsctr_help(struct rcu_ctrlblk *rcp) | |||
99 | return 1; | 97 | return 1; |
100 | } | 98 | } |
101 | local_irq_restore(flags); | 99 | local_irq_restore(flags); |
100 | |||
102 | return 0; | 101 | return 0; |
103 | } | 102 | } |
104 | 103 | ||
@@ -143,8 +142,8 @@ void rcu_check_callbacks(int cpu, int user) | |||
143 | */ | 142 | */ |
144 | static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp) | 143 | static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp) |
145 | { | 144 | { |
146 | unsigned long flags; | ||
147 | struct rcu_head *next, *list; | 145 | struct rcu_head *next, *list; |
146 | unsigned long flags; | ||
148 | 147 | ||
149 | /* If no RCU callbacks ready to invoke, just return. */ | 148 | /* If no RCU callbacks ready to invoke, just return. */ |
150 | if (&rcp->rcucblist == rcp->donetail) | 149 | if (&rcp->rcucblist == rcp->donetail) |
@@ -182,8 +181,7 @@ static void rcu_process_callbacks(struct softirq_action *unused) | |||
182 | * Null function to handle CPU being onlined. Longer term, we want to | 181 | * Null function to handle CPU being onlined. Longer term, we want to |
183 | * make TINY_RCU avoid using rcupdate.c, but later... | 182 | * make TINY_RCU avoid using rcupdate.c, but later... |
184 | */ | 183 | */ |
185 | int rcu_cpu_notify(struct notifier_block *self, | 184 | int rcu_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) |
186 | unsigned long action, void *hcpu) | ||
187 | { | 185 | { |
188 | return NOTIFY_OK; | 186 | return NOTIFY_OK; |
189 | } | 187 | } |
@@ -223,6 +221,7 @@ static void __call_rcu(struct rcu_head *head, | |||
223 | 221 | ||
224 | head->func = func; | 222 | head->func = func; |
225 | head->next = NULL; | 223 | head->next = NULL; |
224 | |||
226 | local_irq_save(flags); | 225 | local_irq_save(flags); |
227 | *rcp->curtail = head; | 226 | *rcp->curtail = head; |
228 | rcp->curtail = &head->next; | 227 | rcp->curtail = &head->next; |
@@ -234,8 +233,7 @@ static void __call_rcu(struct rcu_head *head, | |||
234 | * period. But since we have but one CPU, that would be after any | 233 | * period. But since we have but one CPU, that would be after any |
235 | * quiescent state. | 234 | * quiescent state. |
236 | */ | 235 | */ |
237 | void call_rcu(struct rcu_head *head, | 236 | void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)) |
238 | void (*func)(struct rcu_head *rcu)) | ||
239 | { | 237 | { |
240 | __call_rcu(head, func, &rcu_ctrlblk); | 238 | __call_rcu(head, func, &rcu_ctrlblk); |
241 | } | 239 | } |
@@ -245,8 +243,7 @@ EXPORT_SYMBOL_GPL(call_rcu); | |||
245 | * Post an RCU bottom-half callback to be invoked after any subsequent | 243 | * Post an RCU bottom-half callback to be invoked after any subsequent |
246 | * quiescent state. | 244 | * quiescent state. |
247 | */ | 245 | */ |
248 | void call_rcu_bh(struct rcu_head *head, | 246 | void call_rcu_bh(struct rcu_head *head, void (*func)(struct rcu_head *rcu)) |
249 | void (*func)(struct rcu_head *rcu)) | ||
250 | { | 247 | { |
251 | __call_rcu(head, func, &rcu_bh_ctrlblk); | 248 | __call_rcu(head, func, &rcu_bh_ctrlblk); |
252 | } | 249 | } |