diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 12:52:14 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 12:52:14 -0500 |
| commit | 607781762e7aae9c976f0a9a8829d4ba3e2da4ab (patch) | |
| tree | 933dad6ecb0be49e9b1ef41b69d5aa256510720e /include | |
| parent | d0b093a8b5ae34ee8be1f7e0dd197fe4788fa1d5 (diff) | |
| parent | 8bfb2f8e655b9d0c45fde679fcd5fd97e34513db (diff) | |
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (31 commits)
rcu: Make RCU's CPU-stall detector be default
rcu: Add expedited grace-period support for preemptible RCU
rcu: Enable fourth level of TREE_RCU hierarchy
rcu: Rename "quiet" functions
rcu: Re-arrange code to reduce #ifdef pain
rcu: Eliminate unneeded function wrapping
rcu: Fix grace-period-stall bug on large systems with CPU hotplug
rcu: Eliminate __rcu_pending() false positives
rcu: Further cleanups of use of lastcomp
rcu: Simplify association of forced quiescent states with grace periods
rcu: Accelerate callback processing on CPUs not detecting GP end
rcu: Mark init-time-only rcu_bootup_announce() as __init
rcu: Simplify association of quiescent states with grace periods
rcu: Rename dynticks_completed to completed_fqs
rcu: Enable synchronize_sched_expedited() fastpath
rcu: Remove inline from forward-referenced functions
rcu: Fix note_new_gpnum() uses of ->gpnum
rcu: Fix synchronization for rcu_process_gp_end() uses of ->completed counter
rcu: Prepare for synchronization fixes: clean up for non-NO_HZ handling of ->completed counter
rcu: Cleanup: balance rcu_irq_enter()/rcu_irq_exit() calls
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/hardirq.h | 24 | ||||
| -rw-r--r-- | include/linux/rcupdate.h | 10 | ||||
| -rw-r--r-- | include/linux/rcutiny.h | 104 | ||||
| -rw-r--r-- | include/linux/rcutree.h | 7 | ||||
| -rw-r--r-- | include/linux/srcu.h | 1 |
5 files changed, 134 insertions, 12 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 6d527ee82b2b..d5b387669dab 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
| @@ -139,10 +139,34 @@ static inline void account_system_vtime(struct task_struct *tsk) | |||
| 139 | #endif | 139 | #endif |
| 140 | 140 | ||
| 141 | #if defined(CONFIG_NO_HZ) | 141 | #if defined(CONFIG_NO_HZ) |
| 142 | #if defined(CONFIG_TINY_RCU) | ||
| 143 | extern void rcu_enter_nohz(void); | ||
| 144 | extern void rcu_exit_nohz(void); | ||
| 145 | |||
| 146 | static inline void rcu_irq_enter(void) | ||
| 147 | { | ||
| 148 | rcu_exit_nohz(); | ||
| 149 | } | ||
| 150 | |||
| 151 | static inline void rcu_irq_exit(void) | ||
| 152 | { | ||
| 153 | rcu_enter_nohz(); | ||
| 154 | } | ||
| 155 | |||
| 156 | static inline void rcu_nmi_enter(void) | ||
| 157 | { | ||
| 158 | } | ||
| 159 | |||
| 160 | static inline void rcu_nmi_exit(void) | ||
| 161 | { | ||
| 162 | } | ||
| 163 | |||
| 164 | #else | ||
| 142 | extern void rcu_irq_enter(void); | 165 | extern void rcu_irq_enter(void); |
| 143 | extern void rcu_irq_exit(void); | 166 | extern void rcu_irq_exit(void); |
| 144 | extern void rcu_nmi_enter(void); | 167 | extern void rcu_nmi_enter(void); |
| 145 | extern void rcu_nmi_exit(void); | 168 | extern void rcu_nmi_exit(void); |
| 169 | #endif | ||
| 146 | #else | 170 | #else |
| 147 | # define rcu_irq_enter() do { } while (0) | 171 | # define rcu_irq_enter() do { } while (0) |
| 148 | # define rcu_irq_exit() do { } while (0) | 172 | # define rcu_irq_exit() do { } while (0) |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 3ebd0b7bcb08..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 | ||
| 56 | extern 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 */ | ||
| 60 | extern void synchronize_rcu_bh(void); | 55 | extern void synchronize_rcu_bh(void); |
| 61 | extern void synchronize_sched(void); | 56 | extern void synchronize_sched(void); |
| 62 | extern void rcu_barrier(void); | 57 | extern void rcu_barrier(void); |
| @@ -67,12 +62,11 @@ extern int sched_expedited_torture_stats(char *page); | |||
| 67 | 62 | ||
| 68 | /* Internal to kernel */ | 63 | /* Internal to kernel */ |
| 69 | extern void rcu_init(void); | 64 | extern void rcu_init(void); |
| 70 | extern void rcu_scheduler_starting(void); | ||
| 71 | extern int rcu_needs_cpu(int cpu); | ||
| 72 | extern int rcu_scheduler_active; | ||
| 73 | 65 | ||
| 74 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 66 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
| 75 | #include <linux/rcutree.h> | 67 | #include <linux/rcutree.h> |
| 68 | #elif defined(CONFIG_TINY_RCU) | ||
| 69 | #include <linux/rcutiny.h> | ||
| 76 | #else | 70 | #else |
| 77 | #error "Unknown RCU implementation specified to kernel configuration" | 71 | #error "Unknown RCU implementation specified to kernel configuration" |
| 78 | #endif | 72 | #endif |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h new file mode 100644 index 000000000000..c4ba9a78721e --- /dev/null +++ b/include/linux/rcutiny.h | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | /* | ||
| 2 | * Read-Copy Update mechanism for mutual exclusion, the Bloatwatch edition. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 17 | * | ||
| 18 | * Copyright IBM Corporation, 2008 | ||
| 19 | * | ||
| 20 | * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
| 21 | * | ||
| 22 | * For detailed explanation of Read-Copy Update mechanism see - | ||
| 23 | * Documentation/RCU | ||
| 24 | */ | ||
| 25 | #ifndef __LINUX_TINY_H | ||
| 26 | #define __LINUX_TINY_H | ||
| 27 | |||
| 28 | #include <linux/cache.h> | ||
| 29 | |||
| 30 | void rcu_sched_qs(int cpu); | ||
| 31 | void rcu_bh_qs(int cpu); | ||
| 32 | |||
| 33 | #define __rcu_read_lock() preempt_disable() | ||
| 34 | #define __rcu_read_unlock() preempt_enable() | ||
| 35 | #define __rcu_read_lock_bh() local_bh_disable() | ||
| 36 | #define __rcu_read_unlock_bh() local_bh_enable() | ||
| 37 | #define call_rcu_sched call_rcu | ||
| 38 | |||
| 39 | #define rcu_init_sched() do { } while (0) | ||
| 40 | extern void rcu_check_callbacks(int cpu, int user); | ||
| 41 | |||
| 42 | static inline int rcu_needs_cpu(int cpu) | ||
| 43 | { | ||
| 44 | return 0; | ||
| 45 | } | ||
| 46 | |||
| 47 | /* | ||
| 48 | * Return the number of grace periods. | ||
| 49 | */ | ||
| 50 | static inline long rcu_batches_completed(void) | ||
| 51 | { | ||
| 52 | return 0; | ||
| 53 | } | ||
| 54 | |||
| 55 | /* | ||
| 56 | * Return the number of bottom-half grace periods. | ||
| 57 | */ | ||
| 58 | static inline long rcu_batches_completed_bh(void) | ||
| 59 | { | ||
| 60 | return 0; | ||
| 61 | } | ||
| 62 | |||
| 63 | extern int rcu_expedited_torture_stats(char *page); | ||
| 64 | |||
| 65 | #define synchronize_rcu synchronize_sched | ||
| 66 | |||
| 67 | static inline void synchronize_rcu_expedited(void) | ||
| 68 | { | ||
| 69 | synchronize_sched(); | ||
| 70 | } | ||
| 71 | |||
| 72 | static inline void synchronize_rcu_bh_expedited(void) | ||
| 73 | { | ||
| 74 | synchronize_sched(); | ||
| 75 | } | ||
| 76 | |||
| 77 | struct notifier_block; | ||
| 78 | |||
| 79 | #ifdef CONFIG_NO_HZ | ||
| 80 | |||
| 81 | extern void rcu_enter_nohz(void); | ||
| 82 | extern void rcu_exit_nohz(void); | ||
| 83 | |||
| 84 | #else /* #ifdef CONFIG_NO_HZ */ | ||
| 85 | |||
| 86 | static inline void rcu_enter_nohz(void) | ||
| 87 | { | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline void rcu_exit_nohz(void) | ||
| 91 | { | ||
| 92 | } | ||
| 93 | |||
| 94 | #endif /* #else #ifdef CONFIG_NO_HZ */ | ||
| 95 | |||
| 96 | static inline void rcu_scheduler_starting(void) | ||
| 97 | { | ||
| 98 | } | ||
| 99 | |||
| 100 | static inline void exit_rcu(void) | ||
| 101 | { | ||
| 102 | } | ||
| 103 | |||
| 104 | #endif /* __LINUX_RCUTINY_H */ | ||
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 9642c6bcb399..c93eee5911b0 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
| @@ -34,15 +34,15 @@ struct notifier_block; | |||
| 34 | 34 | ||
| 35 | extern void rcu_sched_qs(int cpu); | 35 | extern void rcu_sched_qs(int cpu); |
| 36 | extern void rcu_bh_qs(int cpu); | 36 | extern void rcu_bh_qs(int cpu); |
| 37 | extern int rcu_cpu_notify(struct notifier_block *self, | ||
| 38 | unsigned long action, void *hcpu); | ||
| 39 | extern int rcu_needs_cpu(int cpu); | 37 | extern int rcu_needs_cpu(int cpu); |
| 38 | extern void rcu_scheduler_starting(void); | ||
| 40 | extern int rcu_expedited_torture_stats(char *page); | 39 | extern int rcu_expedited_torture_stats(char *page); |
| 41 | 40 | ||
| 42 | #ifdef CONFIG_TREE_PREEMPT_RCU | 41 | #ifdef CONFIG_TREE_PREEMPT_RCU |
| 43 | 42 | ||
| 44 | extern void __rcu_read_lock(void); | 43 | extern void __rcu_read_lock(void); |
| 45 | extern void __rcu_read_unlock(void); | 44 | extern void __rcu_read_unlock(void); |
| 45 | extern void synchronize_rcu(void); | ||
| 46 | extern void exit_rcu(void); | 46 | extern void exit_rcu(void); |
| 47 | 47 | ||
| 48 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 48 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
| @@ -57,7 +57,7 @@ static inline void __rcu_read_unlock(void) | |||
| 57 | preempt_enable(); | 57 | preempt_enable(); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | #define __synchronize_sched() synchronize_rcu() | 60 | #define synchronize_rcu synchronize_sched |
| 61 | 61 | ||
| 62 | static inline void exit_rcu(void) | 62 | static inline void exit_rcu(void) |
| 63 | { | 63 | { |
| @@ -83,7 +83,6 @@ static inline void synchronize_rcu_bh_expedited(void) | |||
| 83 | synchronize_sched_expedited(); | 83 | synchronize_sched_expedited(); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | extern void __rcu_init(void); | ||
| 87 | extern void rcu_check_callbacks(int cpu, int user); | 86 | extern void rcu_check_callbacks(int cpu, int user); |
| 88 | 87 | ||
| 89 | extern long rcu_batches_completed(void); | 88 | extern long rcu_batches_completed(void); |
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index aca0eee53930..4765d97dcafb 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
| @@ -48,6 +48,7 @@ void cleanup_srcu_struct(struct srcu_struct *sp); | |||
| 48 | int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); | 48 | int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); |
| 49 | void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); | 49 | void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); |
| 50 | void synchronize_srcu(struct srcu_struct *sp); | 50 | void synchronize_srcu(struct srcu_struct *sp); |
| 51 | void synchronize_srcu_expedited(struct srcu_struct *sp); | ||
| 51 | long srcu_batches_completed(struct srcu_struct *sp); | 52 | long srcu_batches_completed(struct srcu_struct *sp); |
| 52 | 53 | ||
| 53 | #endif | 54 | #endif |
