diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-13 17:43:01 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-13 17:43:01 -0500 |
| commit | 4e3eaddd142e2142c048c5052a0a9d2604fccfc6 (patch) | |
| tree | 5bc45a286502e54e790c54948f22364c5afd9d89 | |
| parent | 8655e7e3ddec60603c4f6c14cdf642e2ba198df8 (diff) | |
| parent | b97c4bc16734a2e597dac7f91ee9eb78f4aeef9a (diff) | |
Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
locking: Make sparse work with inline spinlocks and rwlocks
x86/mce: Fix RCU lockdep splats
rcu: Increase RCU CPU stall timeouts if PROVE_RCU
ftrace: Replace read_barrier_depends() with rcu_dereference_raw()
rcu: Suppress RCU lockdep warnings during early boot
rcu, ftrace: Fix RCU lockdep splat in ftrace_perf_buf_prepare()
rcu: Suppress __mpol_dup() false positive from RCU lockdep
rcu: Make rcu_read_lock_sched_held() handle !PREEMPT
rcu: Add control variables to lockdep_rcu_dereference() diagnostics
rcu, cgroup: Relax the check in task_subsys_state() as early boot is now handled by lockdep-RCU
rcu: Use wrapper function instead of exporting tasklist_lock
sched, rcu: Fix rcu_dereference() for RCU-lockdep
rcu: Make task_subsys_state() RCU-lockdep checks handle boot-time use
rcu: Fix holdoff for accelerated GPs for last non-dynticked CPU
x86/gart: Unexport gart_iommu_aperture
Fix trivial conflicts in kernel/trace/ftrace.c
| -rw-r--r-- | arch/x86/kernel/aperture_64.c | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 11 | ||||
| -rw-r--r-- | include/linux/cred.h | 2 | ||||
| -rw-r--r-- | include/linux/rcupdate.h | 45 | ||||
| -rw-r--r-- | include/linux/rwlock.h | 20 | ||||
| -rw-r--r-- | include/linux/sched.h | 4 | ||||
| -rw-r--r-- | include/linux/spinlock.h | 13 | ||||
| -rw-r--r-- | include/trace/ftrace.h | 4 | ||||
| -rw-r--r-- | kernel/exit.c | 2 | ||||
| -rw-r--r-- | kernel/fork.c | 9 | ||||
| -rw-r--r-- | kernel/lockdep.c | 1 | ||||
| -rw-r--r-- | kernel/pid.c | 4 | ||||
| -rw-r--r-- | kernel/rcutree.h | 21 | ||||
| -rw-r--r-- | kernel/rcutree_plugin.h | 8 | ||||
| -rw-r--r-- | kernel/sched_fair.c | 2 | ||||
| -rw-r--r-- | kernel/trace/ftrace.c | 22 | ||||
| -rw-r--r-- | kernel/trace/trace_event_profile.c | 4 | ||||
| -rw-r--r-- | mm/mempolicy.c | 2 |
18 files changed, 120 insertions, 55 deletions
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index f147a95fd84a..3704997e8b25 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c | |||
| @@ -31,7 +31,6 @@ | |||
| 31 | #include <asm/x86_init.h> | 31 | #include <asm/x86_init.h> |
| 32 | 32 | ||
| 33 | int gart_iommu_aperture; | 33 | int gart_iommu_aperture; |
| 34 | EXPORT_SYMBOL_GPL(gart_iommu_aperture); | ||
| 35 | int gart_iommu_aperture_disabled __initdata; | 34 | int gart_iommu_aperture_disabled __initdata; |
| 36 | int gart_iommu_aperture_allowed __initdata; | 35 | int gart_iommu_aperture_allowed __initdata; |
| 37 | 36 | ||
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 28cba46bf32c..bd58de4d7a29 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
| @@ -46,6 +46,11 @@ | |||
| 46 | 46 | ||
| 47 | #include "mce-internal.h" | 47 | #include "mce-internal.h" |
| 48 | 48 | ||
| 49 | #define rcu_dereference_check_mce(p) \ | ||
| 50 | rcu_dereference_check((p), \ | ||
| 51 | rcu_read_lock_sched_held() || \ | ||
| 52 | lockdep_is_held(&mce_read_mutex)) | ||
| 53 | |||
| 49 | #define CREATE_TRACE_POINTS | 54 | #define CREATE_TRACE_POINTS |
| 50 | #include <trace/events/mce.h> | 55 | #include <trace/events/mce.h> |
| 51 | 56 | ||
| @@ -158,7 +163,7 @@ void mce_log(struct mce *mce) | |||
| 158 | mce->finished = 0; | 163 | mce->finished = 0; |
| 159 | wmb(); | 164 | wmb(); |
| 160 | for (;;) { | 165 | for (;;) { |
| 161 | entry = rcu_dereference(mcelog.next); | 166 | entry = rcu_dereference_check_mce(mcelog.next); |
| 162 | for (;;) { | 167 | for (;;) { |
| 163 | /* | 168 | /* |
| 164 | * When the buffer fills up discard new entries. | 169 | * When the buffer fills up discard new entries. |
| @@ -1500,7 +1505,7 @@ static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize, | |||
| 1500 | return -ENOMEM; | 1505 | return -ENOMEM; |
| 1501 | 1506 | ||
| 1502 | mutex_lock(&mce_read_mutex); | 1507 | mutex_lock(&mce_read_mutex); |
| 1503 | next = rcu_dereference(mcelog.next); | 1508 | next = rcu_dereference_check_mce(mcelog.next); |
| 1504 | 1509 | ||
| 1505 | /* Only supports full reads right now */ | 1510 | /* Only supports full reads right now */ |
| 1506 | if (*off != 0 || usize < MCE_LOG_LEN*sizeof(struct mce)) { | 1511 | if (*off != 0 || usize < MCE_LOG_LEN*sizeof(struct mce)) { |
| @@ -1565,7 +1570,7 @@ timeout: | |||
| 1565 | static unsigned int mce_poll(struct file *file, poll_table *wait) | 1570 | static unsigned int mce_poll(struct file *file, poll_table *wait) |
| 1566 | { | 1571 | { |
| 1567 | poll_wait(file, &mce_wait, wait); | 1572 | poll_wait(file, &mce_wait, wait); |
| 1568 | if (rcu_dereference(mcelog.next)) | 1573 | if (rcu_dereference_check_mce(mcelog.next)) |
| 1569 | return POLLIN | POLLRDNORM; | 1574 | return POLLIN | POLLRDNORM; |
| 1570 | return 0; | 1575 | return 0; |
| 1571 | } | 1576 | } |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 4db09f89b637..52507c3e1387 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
| @@ -280,7 +280,7 @@ static inline void put_cred(const struct cred *_cred) | |||
| 280 | * task or by holding tasklist_lock to prevent it from being unlinked. | 280 | * task or by holding tasklist_lock to prevent it from being unlinked. |
| 281 | */ | 281 | */ |
| 282 | #define __task_cred(task) \ | 282 | #define __task_cred(task) \ |
| 283 | ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_is_held(&tasklist_lock)))) | 283 | ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_tasklist_lock_is_held()))) |
| 284 | 284 | ||
| 285 | /** | 285 | /** |
| 286 | * get_task_cred - Get another task's objective credentials | 286 | * get_task_cred - Get another task's objective credentials |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index a005cac5e302..3024050c82a1 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -101,6 +101,11 @@ extern struct lockdep_map rcu_sched_lock_map; | |||
| 101 | # define rcu_read_release_sched() \ | 101 | # define rcu_read_release_sched() \ |
| 102 | lock_release(&rcu_sched_lock_map, 1, _THIS_IP_) | 102 | lock_release(&rcu_sched_lock_map, 1, _THIS_IP_) |
| 103 | 103 | ||
| 104 | static inline int debug_lockdep_rcu_enabled(void) | ||
| 105 | { | ||
| 106 | return likely(rcu_scheduler_active && debug_locks); | ||
| 107 | } | ||
| 108 | |||
| 104 | /** | 109 | /** |
| 105 | * rcu_read_lock_held - might we be in RCU read-side critical section? | 110 | * rcu_read_lock_held - might we be in RCU read-side critical section? |
| 106 | * | 111 | * |
| @@ -108,12 +113,14 @@ extern struct lockdep_map rcu_sched_lock_map; | |||
| 108 | * an RCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, | 113 | * an RCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, |
| 109 | * this assumes we are in an RCU read-side critical section unless it can | 114 | * this assumes we are in an RCU read-side critical section unless it can |
| 110 | * prove otherwise. | 115 | * prove otherwise. |
| 116 | * | ||
| 117 | * Check rcu_scheduler_active to prevent false positives during boot. | ||
| 111 | */ | 118 | */ |
| 112 | static inline int rcu_read_lock_held(void) | 119 | static inline int rcu_read_lock_held(void) |
| 113 | { | 120 | { |
| 114 | if (debug_locks) | 121 | if (!debug_lockdep_rcu_enabled()) |
| 115 | return lock_is_held(&rcu_lock_map); | 122 | return 1; |
| 116 | return 1; | 123 | return lock_is_held(&rcu_lock_map); |
| 117 | } | 124 | } |
| 118 | 125 | ||
| 119 | /** | 126 | /** |
| @@ -123,12 +130,14 @@ static inline int rcu_read_lock_held(void) | |||
| 123 | * an RCU-bh read-side critical section. In absence of CONFIG_PROVE_LOCKING, | 130 | * an RCU-bh read-side critical section. In absence of CONFIG_PROVE_LOCKING, |
| 124 | * this assumes we are in an RCU-bh read-side critical section unless it can | 131 | * this assumes we are in an RCU-bh read-side critical section unless it can |
| 125 | * prove otherwise. | 132 | * prove otherwise. |
| 133 | * | ||
| 134 | * Check rcu_scheduler_active to prevent false positives during boot. | ||
| 126 | */ | 135 | */ |
| 127 | static inline int rcu_read_lock_bh_held(void) | 136 | static inline int rcu_read_lock_bh_held(void) |
| 128 | { | 137 | { |
| 129 | if (debug_locks) | 138 | if (!debug_lockdep_rcu_enabled()) |
| 130 | return lock_is_held(&rcu_bh_lock_map); | 139 | return 1; |
| 131 | return 1; | 140 | return lock_is_held(&rcu_bh_lock_map); |
| 132 | } | 141 | } |
| 133 | 142 | ||
| 134 | /** | 143 | /** |
| @@ -139,15 +148,26 @@ static inline int rcu_read_lock_bh_held(void) | |||
| 139 | * this assumes we are in an RCU-sched read-side critical section unless it | 148 | * this assumes we are in an RCU-sched read-side critical section unless it |
| 140 | * can prove otherwise. Note that disabling of preemption (including | 149 | * can prove otherwise. Note that disabling of preemption (including |
| 141 | * disabling irqs) counts as an RCU-sched read-side critical section. | 150 | * disabling irqs) counts as an RCU-sched read-side critical section. |
| 151 | * | ||
| 152 | * Check rcu_scheduler_active to prevent false positives during boot. | ||
| 142 | */ | 153 | */ |
| 154 | #ifdef CONFIG_PREEMPT | ||
| 143 | static inline int rcu_read_lock_sched_held(void) | 155 | static inline int rcu_read_lock_sched_held(void) |
| 144 | { | 156 | { |
| 145 | int lockdep_opinion = 0; | 157 | int lockdep_opinion = 0; |
| 146 | 158 | ||
| 159 | if (!debug_lockdep_rcu_enabled()) | ||
| 160 | return 1; | ||
| 147 | if (debug_locks) | 161 | if (debug_locks) |
| 148 | lockdep_opinion = lock_is_held(&rcu_sched_lock_map); | 162 | lockdep_opinion = lock_is_held(&rcu_sched_lock_map); |
| 149 | return lockdep_opinion || preempt_count() != 0 || !rcu_scheduler_active; | 163 | return lockdep_opinion || preempt_count() != 0; |
| 164 | } | ||
| 165 | #else /* #ifdef CONFIG_PREEMPT */ | ||
| 166 | static inline int rcu_read_lock_sched_held(void) | ||
