aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2009-11-22 11:53:50 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-22 12:58:16 -0500
commit6ebb237bece23275d1da149b61a342f0d4d06a08 (patch)
tree5f3d99f6ce2e1e98736e5708eecb5bf217f78fde /include
parent9f680ab41485edfdc96331b70afa7513aa0a7720 (diff)
rcu: Re-arrange code to reduce #ifdef pain
Remove #ifdefs from kernel/rcupdate.c and include/linux/rcupdate.h by moving code to include/linux/rcutiny.h, include/linux/rcutree.h, and kernel/rcutree.c. Also remove some definitions that are no longer used. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: laijs@cn.fujitsu.com Cc: dipankar@in.ibm.com Cc: mathieu.desnoyers@polymtl.ca Cc: josh@joshtriplett.org Cc: dvhltc@us.ibm.com Cc: niv@us.ibm.com Cc: peterz@infradead.org Cc: rostedt@goodmis.org Cc: Valdis.Kletnieks@vt.edu Cc: dhowells@redhat.com LKML-Reference: <1258908830885-git-send-email-> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/linux/rcupdate.h12
-rw-r--r--include/linux/rcutiny.h11
-rw-r--r--include/linux/rcutree.h4
3 files changed, 14 insertions, 13 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 2f1bc42a3b82..24440f4bf476 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -52,11 +52,6 @@ struct rcu_head {
52}; 52};
53 53
54/* Exported common interfaces */ 54/* Exported common interfaces */
55#ifdef CONFIG_TREE_PREEMPT_RCU
56extern void synchronize_rcu(void);
57#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */
58#define synchronize_rcu synchronize_sched
59#endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */
60extern void synchronize_rcu_bh(void); 55extern void synchronize_rcu_bh(void);
61extern void synchronize_sched(void); 56extern void synchronize_sched(void);
62extern void rcu_barrier(void); 57extern void rcu_barrier(void);
@@ -67,13 +62,6 @@ extern int sched_expedited_torture_stats(char *page);
67 62
68/* Internal to kernel */ 63/* Internal to kernel */
69extern void rcu_init(void); 64extern void rcu_init(void);
70extern void rcu_scheduler_starting(void);
71#ifndef CONFIG_TINY_RCU
72extern int rcu_needs_cpu(int cpu);
73#else
74static inline int rcu_needs_cpu(int cpu) { return 0; }
75#endif
76extern int rcu_scheduler_active;
77 65
78#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 66#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
79#include <linux/rcutree.h> 67#include <linux/rcutree.h>
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index a3b6272af2dd..c4ba9a78721e 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -39,6 +39,11 @@ void rcu_bh_qs(int cpu);
39#define rcu_init_sched() do { } while (0) 39#define rcu_init_sched() do { } while (0)
40extern void rcu_check_callbacks(int cpu, int user); 40extern void rcu_check_callbacks(int cpu, int user);
41 41
42static inline int rcu_needs_cpu(int cpu)
43{
44 return 0;
45}
46
42/* 47/*
43 * Return the number of grace periods. 48 * Return the number of grace periods.
44 */ 49 */
@@ -57,6 +62,8 @@ static inline long rcu_batches_completed_bh(void)
57 62
58extern int rcu_expedited_torture_stats(char *page); 63extern int rcu_expedited_torture_stats(char *page);
59 64
65#define synchronize_rcu synchronize_sched
66
60static inline void synchronize_rcu_expedited(void) 67static inline void synchronize_rcu_expedited(void)
61{ 68{
62 synchronize_sched(); 69 synchronize_sched();
@@ -86,6 +93,10 @@ static inline void rcu_exit_nohz(void)
86 93
87#endif /* #else #ifdef CONFIG_NO_HZ */ 94#endif /* #else #ifdef CONFIG_NO_HZ */
88 95
96static inline void rcu_scheduler_starting(void)
97{
98}
99
89static inline void exit_rcu(void) 100static inline void exit_rcu(void)
90{ 101{
91} 102}
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 111a65257350..c93eee5911b0 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -35,12 +35,14 @@ struct notifier_block;
35extern void rcu_sched_qs(int cpu); 35extern void rcu_sched_qs(int cpu);
36extern void rcu_bh_qs(int cpu); 36extern void rcu_bh_qs(int cpu);
37extern int rcu_needs_cpu(int cpu); 37extern int rcu_needs_cpu(int cpu);
38extern void rcu_scheduler_starting(void);
38extern int rcu_expedited_torture_stats(char *page); 39extern int rcu_expedited_torture_stats(char *page);
39 40
40#ifdef CONFIG_TREE_PREEMPT_RCU 41#ifdef CONFIG_TREE_PREEMPT_RCU
41 42
42extern void __rcu_read_lock(void); 43extern void __rcu_read_lock(void);
43extern void __rcu_read_unlock(void); 44extern void __rcu_read_unlock(void);
45extern void synchronize_rcu(void);
44extern void exit_rcu(void); 46extern void exit_rcu(void);
45 47
46#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 48#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */
@@ -55,7 +57,7 @@ static inline void __rcu_read_unlock(void)
55 preempt_enable(); 57 preempt_enable();
56} 58}
57 59
58#define __synchronize_sched() synchronize_rcu() 60#define synchronize_rcu synchronize_sched
59 61
60static inline void exit_rcu(void) 62static inline void exit_rcu(void)
61{ 63{