aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/rcutiny.h6
-rw-r--r--kernel/rcutiny.c49
2 files changed, 25 insertions, 30 deletions
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 891073c264dc..2c1fe8373e71 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -20,9 +20,8 @@
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#ifndef __LINUX_TINY_H 25#ifndef __LINUX_TINY_H
27#define __LINUX_TINY_H 26#define __LINUX_TINY_H
28 27
@@ -70,8 +69,7 @@ static inline void synchronize_rcu_bh_expedited(void)
70} 69}
71 70
72struct notifier_block; 71struct notifier_block;
73extern int rcu_cpu_notify(struct notifier_block *self, 72extern int rcu_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu);
74 unsigned long action, void *hcpu);
75 73
76#ifdef CONFIG_NO_HZ 74#ifdef CONFIG_NO_HZ
77 75
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. */
41struct rcu_ctrlblk { 40struct rcu_ctrlblk {
@@ -46,14 +45,13 @@ struct rcu_ctrlblk {
46 45
47/* Definition for rcupdate control block. */ 46/* Definition for rcupdate control block. */
48static struct rcu_ctrlblk rcu_ctrlblk = { 47static 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
53static struct rcu_ctrlblk rcu_bh_ctrlblk = { 52static 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 */
90static int rcu_qsctr_help(struct rcu_ctrlblk *rcp) 88static 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 */
144static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp) 143static 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 */
185int rcu_cpu_notify(struct notifier_block *self, 184int 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 */
237void call_rcu(struct rcu_head *head, 236void 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 */
248void call_rcu_bh(struct rcu_head *head, 246void 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}