diff options
Diffstat (limited to 'include/linux/rcutiny.h')
| -rw-r--r-- | include/linux/rcutiny.h | 104 |
1 files changed, 51 insertions, 53 deletions
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index e2e893144a84..13877cb93a60 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
| @@ -27,103 +27,101 @@ | |||
| 27 | 27 | ||
| 28 | #include <linux/cache.h> | 28 | #include <linux/cache.h> |
| 29 | 29 | ||
| 30 | void rcu_sched_qs(int cpu); | 30 | #define rcu_init_sched() do { } while (0) |
| 31 | void rcu_bh_qs(int cpu); | ||
| 32 | static inline void rcu_note_context_switch(int cpu) | ||
| 33 | { | ||
| 34 | rcu_sched_qs(cpu); | ||
| 35 | } | ||
| 36 | 31 | ||
| 37 | #define __rcu_read_lock() preempt_disable() | 32 | #ifdef CONFIG_TINY_RCU |
| 38 | #define __rcu_read_unlock() preempt_enable() | ||
| 39 | #define __rcu_read_lock_bh() local_bh_disable() | ||
| 40 | #define __rcu_read_unlock_bh() local_bh_enable() | ||
| 41 | #define call_rcu_sched call_rcu | ||
| 42 | 33 | ||
| 43 | #define rcu_init_sched() do { } while (0) | 34 | static inline void synchronize_rcu_expedited(void) |
| 44 | extern void rcu_check_callbacks(int cpu, int user); | 35 | { |
| 36 | synchronize_sched(); /* Only one CPU, so pretty fast anyway!!! */ | ||
| 37 | } | ||
| 45 | 38 | ||
| 46 | static inline int rcu_needs_cpu(int cpu) | 39 | static inline void rcu_barrier(void) |
| 47 | { | 40 | { |
| 48 | return 0; | 41 | rcu_barrier_sched(); /* Only one CPU, so only one list of callbacks! */ |
| 49 | } | 42 | } |
| 50 | 43 | ||
| 51 | /* | 44 | #else /* #ifdef CONFIG_TINY_RCU */ |
| 52 | * Return the number of grace periods. | 45 | |
| 53 | */ | 46 | void rcu_barrier(void); |
| 54 | static inline long rcu_batches_completed(void) | 47 | void synchronize_rcu_expedited(void); |
| 48 | |||
| 49 | #endif /* #else #ifdef CONFIG_TINY_RCU */ | ||
| 50 | |||
| 51 | static inline void synchronize_rcu_bh(void) | ||
| 55 | { | 52 | { |
| 56 | return 0; | 53 | synchronize_sched(); |
| 57 | } | 54 | } |
| 58 | 55 | ||
| 59 | /* | 56 | static inline void synchronize_rcu_bh_expedited(void) |
| 60 | * Return the number of bottom-half grace periods. | ||
| 61 | */ | ||
| 62 | static inline long rcu_batches_completed_bh(void) | ||
| 63 | { | 57 | { |
| 64 | return 0; | 58 | synchronize_sched(); |
| 65 | } | 59 | } |
| 66 | 60 | ||
| 67 | static inline void rcu_force_quiescent_state(void) | 61 | #ifdef CONFIG_TINY_RCU |
| 62 | |||
| 63 | static inline void rcu_preempt_note_context_switch(void) | ||
| 68 | { | 64 | { |
| 69 | } | 65 | } |
| 70 | 66 | ||
| 71 | static inline void rcu_bh_force_quiescent_state(void) | 67 | static inline void exit_rcu(void) |
| 72 | { | 68 | { |
| 73 | } | 69 | } |
| 74 | 70 | ||
| 75 | static inline void rcu_sched_force_quiescent_state(void) | 71 | static inline int rcu_needs_cpu(int cpu) |
| 76 | { | 72 | { |
| 73 | return 0; | ||
| 77 | } | 74 | } |
| 78 | 75 | ||
| 79 | extern void synchronize_sched(void); | 76 | #else /* #ifdef CONFIG_TINY_RCU */ |
| 77 | |||
| 78 | void rcu_preempt_note_context_switch(void); | ||
| 79 | extern void exit_rcu(void); | ||
| 80 | int rcu_preempt_needs_cpu(void); | ||
| 80 | 81 | ||
| 81 | static inline void synchronize_rcu(void) | 82 | static inline int rcu_needs_cpu(int cpu) |
| 82 | { | 83 | { |
| 83 | synchronize_sched(); | 84 | return rcu_preempt_needs_cpu(); |
| 84 | } | 85 | } |
| 85 | 86 | ||
| 86 | static inline void synchronize_rcu_bh(void) | 87 | #endif /* #else #ifdef CONFIG_TINY_RCU */ |
| 88 | |||
| 89 | static inline void rcu_note_context_switch(int cpu) | ||
| 87 | { | 90 | { |
| 88 | synchronize_sched(); | 91 | rcu_sched_qs(cpu); |
| 92 | rcu_preempt_note_context_switch(); | ||
| 89 | } | 93 | } |
| 90 | 94 | ||
| 91 | static inline void synchronize_rcu_expedited(void) | 95 | /* |
| 96 | * Return the number of grace periods. | ||
| 97 | */ | ||
| 98 | static inline long rcu_batches_completed(void) | ||
| 92 | { | 99 | { |
| 93 | synchronize_sched(); | 100 | return 0; |
| 94 | } | 101 | } |
| 95 | 102 | ||
| 96 | static inline void synchronize_rcu_bh_expedited(void) | 103 | /* |
| 104 | * Return the number of bottom-half grace periods. | ||
| 105 | */ | ||
| 106 | static inline long rcu_batches_completed_bh(void) | ||
| 97 | { | 107 | { |
| 98 | synchronize_sched(); | 108 | return 0; |
| 99 | } | 109 | } |
| 100 | 110 | ||
| 101 | struct notifier_block; | 111 | static inline void rcu_force_quiescent_state(void) |
| 102 | |||
| 103 | #ifdef CONFIG_NO_HZ | ||
| 104 | |||
| 105 | extern void rcu_enter_nohz(void); | ||
| 106 | extern void rcu_exit_nohz(void); | ||
| 107 | |||
| 108 | #else /* #ifdef CONFIG_NO_HZ */ | ||
| 109 | |||
| 110 | static inline void rcu_enter_nohz(void) | ||
| 111 | { | 112 | { |
| 112 | } | 113 | } |
| 113 | 114 | ||
| 114 | static inline void rcu_exit_nohz(void) | 115 | static inline void rcu_bh_force_quiescent_state(void) |
| 115 | { | 116 | { |
| 116 | } | 117 | } |
| 117 | 118 | ||
| 118 | #endif /* #else #ifdef CONFIG_NO_HZ */ | 119 | static inline void rcu_sched_force_quiescent_state(void) |
| 119 | |||
| 120 | static inline void exit_rcu(void) | ||
| 121 | { | 120 | { |
| 122 | } | 121 | } |
| 123 | 122 | ||
| 124 | static inline int rcu_preempt_depth(void) | 123 | static inline void rcu_cpu_stall_reset(void) |
| 125 | { | 124 | { |
| 126 | return 0; | ||
| 127 | } | 125 | } |
| 128 | 126 | ||
| 129 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 127 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
