aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/rcupdate.h23
-rw-r--r--include/linux/tracepoint.h2
-rw-r--r--kernel/rcupdate.c23
-rw-r--r--kernel/softlockup.c4
-rw-r--r--mm/bootmem.c13
5 files changed, 32 insertions, 33 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 3024050c82a1..872a98e13d6a 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -123,22 +123,11 @@ static inline int rcu_read_lock_held(void)
123 return lock_is_held(&rcu_lock_map); 123 return lock_is_held(&rcu_lock_map);
124} 124}
125 125
126/** 126/*
127 * rcu_read_lock_bh_held - might we be in RCU-bh read-side critical section? 127 * rcu_read_lock_bh_held() is defined out of line to avoid #include-file
128 * 128 * hell.
129 * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in
130 * an RCU-bh read-side critical section. In absence of CONFIG_PROVE_LOCKING,
131 * this assumes we are in an RCU-bh read-side critical section unless it can
132 * prove otherwise.
133 *
134 * Check rcu_scheduler_active to prevent false positives during boot.
135 */ 129 */
136static inline int rcu_read_lock_bh_held(void) 130extern int rcu_read_lock_bh_held(void);
137{
138 if (!debug_lockdep_rcu_enabled())
139 return 1;
140 return lock_is_held(&rcu_bh_lock_map);
141}
142 131
143/** 132/**
144 * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section? 133 * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section?
@@ -160,7 +149,7 @@ static inline int rcu_read_lock_sched_held(void)
160 return 1; 149 return 1;
161 if (debug_locks) 150 if (debug_locks)
162 lockdep_opinion = lock_is_held(&rcu_sched_lock_map); 151 lockdep_opinion = lock_is_held(&rcu_sched_lock_map);
163 return lockdep_opinion || preempt_count() != 0; 152 return lockdep_opinion || preempt_count() != 0 || irqs_disabled();
164} 153}
165#else /* #ifdef CONFIG_PREEMPT */ 154#else /* #ifdef CONFIG_PREEMPT */
166static inline int rcu_read_lock_sched_held(void) 155static inline int rcu_read_lock_sched_held(void)
@@ -191,7 +180,7 @@ static inline int rcu_read_lock_bh_held(void)
191#ifdef CONFIG_PREEMPT 180#ifdef CONFIG_PREEMPT
192static inline int rcu_read_lock_sched_held(void) 181static inline int rcu_read_lock_sched_held(void)
193{ 182{
194 return !rcu_scheduler_active || preempt_count() != 0; 183 return !rcu_scheduler_active || preempt_count() != 0 || irqs_disabled();
195} 184}
196#else /* #ifdef CONFIG_PREEMPT */ 185#else /* #ifdef CONFIG_PREEMPT */
197static inline int rcu_read_lock_sched_held(void) 186static inline int rcu_read_lock_sched_held(void)
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index f59604ed0ec6..78b4bd3be496 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -49,7 +49,7 @@ struct tracepoint {
49 void **it_func; \ 49 void **it_func; \
50 \ 50 \
51 rcu_read_lock_sched_notrace(); \ 51 rcu_read_lock_sched_notrace(); \
52 it_func = rcu_dereference((tp)->funcs); \ 52 it_func = rcu_dereference_sched((tp)->funcs); \
53 if (it_func) { \ 53 if (it_func) { \
54 do { \ 54 do { \
55 ((void(*)(proto))(*it_func))(args); \ 55 ((void(*)(proto))(*it_func))(args); \
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index f1125c1a6321..63fe25433980 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -45,6 +45,7 @@
45#include <linux/mutex.h> 45#include <linux/mutex.h>
46#include <linux/module.h> 46#include <linux/module.h>
47#include <linux/kernel_stat.h> 47#include <linux/kernel_stat.h>
48#include <linux/hardirq.h>
48 49
49#ifdef CONFIG_DEBUG_LOCK_ALLOC 50#ifdef CONFIG_DEBUG_LOCK_ALLOC
50static struct lock_class_key rcu_lock_key; 51static struct lock_class_key rcu_lock_key;
@@ -66,6 +67,28 @@ EXPORT_SYMBOL_GPL(rcu_sched_lock_map);
66int rcu_scheduler_active __read_mostly; 67int rcu_scheduler_active __read_mostly;
67EXPORT_SYMBOL_GPL(rcu_scheduler_active); 68EXPORT_SYMBOL_GPL(rcu_scheduler_active);
68 69
70#ifdef CONFIG_DEBUG_LOCK_ALLOC
71
72/**
73 * rcu_read_lock_bh_held - might we be in RCU-bh read-side critical section?
74 *
75 * Check for bottom half being disabled, which covers both the
76 * CONFIG_PROVE_RCU and not cases. Note that if someone uses
77 * rcu_read_lock_bh(), but then later enables BH, lockdep (if enabled)
78 * will show the situation.
79 *
80 * Check debug_lockdep_rcu_enabled() to prevent false positives during boot.
81 */
82int rcu_read_lock_bh_held(void)
83{
84 if (!debug_lockdep_rcu_enabled())
85 return 1;
86 return in_softirq();
87}
88EXPORT_SYMBOL_GPL(rcu_read_lock_bh_held);
89
90#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
91
69/* 92/*
70 * This function is invoked towards the end of the scheduler's initialization 93 * This function is invoked towards the end of the scheduler's initialization
71 * process. Before this is called, the idle task might contain 94 * process. Before this is called, the idle task might contain
diff --git a/kernel/softlockup.c b/kernel/softlockup.c
index 0d4c7898ab80..4b493f67dcb5 100644
--- a/kernel/softlockup.c
+++ b/kernel/softlockup.c
@@ -155,11 +155,11 @@ void softlockup_tick(void)
155 * Wake up the high-prio watchdog task twice per 155 * Wake up the high-prio watchdog task twice per
156 * threshold timespan. 156 * threshold timespan.
157 */ 157 */
158 if (now > touch_ts + softlockup_thresh/2) 158 if (time_after(now - softlockup_thresh/2, touch_ts))
159 wake_up_process(per_cpu(softlockup_watchdog, this_cpu)); 159 wake_up_process(per_cpu(softlockup_watchdog, this_cpu));
160 160
161 /* Warn about unreasonable delays: */ 161 /* Warn about unreasonable delays: */
162 if (now <= (touch_ts + softlockup_thresh)) 162 if (time_before_eq(now - softlockup_thresh, touch_ts))
163 return; 163 return;
164 164
165 per_cpu(softlockup_print_ts, this_cpu) = touch_ts; 165 per_cpu(softlockup_print_ts, this_cpu) = touch_ts;
diff --git a/mm/bootmem.c b/mm/bootmem.c
index d7c791ef0036..9b134460b016 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -180,19 +180,12 @@ static void __init __free_pages_memory(unsigned long start, unsigned long end)
180 end_aligned = end & ~(BITS_PER_LONG - 1); 180 end_aligned = end & ~(BITS_PER_LONG - 1);
181 181
182 if (end_aligned <= start_aligned) { 182 if (end_aligned <= start_aligned) {
183#if 1
184 printk(KERN_DEBUG " %lx - %lx\n", start, end);
185#endif
186 for (i = start; i < end; i++) 183 for (i = start; i < end; i++)
187 __free_pages_bootmem(pfn_to_page(i), 0); 184 __free_pages_bootmem(pfn_to_page(i), 0);
188 185
189 return; 186 return;
190 } 187 }
191 188
192#if 1
193 printk(KERN_DEBUG " %lx %lx - %lx %lx\n",
194 start, start_aligned, end_aligned, end);
195#endif
196 for (i = start; i < start_aligned; i++) 189 for (i = start; i < start_aligned; i++)
197 __free_pages_bootmem(pfn_to_page(i), 0); 190 __free_pages_bootmem(pfn_to_page(i), 0);
198 191
@@ -428,9 +421,6 @@ void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
428{ 421{
429#ifdef CONFIG_NO_BOOTMEM 422#ifdef CONFIG_NO_BOOTMEM
430 free_early(physaddr, physaddr + size); 423 free_early(physaddr, physaddr + size);
431#if 0
432 printk(KERN_DEBUG "free %lx %lx\n", physaddr, size);
433#endif
434#else 424#else
435 unsigned long start, end; 425 unsigned long start, end;
436 426
@@ -456,9 +446,6 @@ void __init free_bootmem(unsigned long addr, unsigned long size)
456{ 446{
457#ifdef CONFIG_NO_BOOTMEM 447#ifdef CONFIG_NO_BOOTMEM
458 free_early(addr, addr + size); 448 free_early(addr, addr + size);
459#if 0
460 printk(KERN_DEBUG "free %lx %lx\n", addr, size);
461#endif
462#else 449#else
463 unsigned long start, end; 450 unsigned long start, end;
464 451