diff options
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r-- | kernel/lockdep.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 9a1e2bcc4b8d..981cd4854281 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -2254,7 +2254,7 @@ void trace_softirqs_off(unsigned long ip) | |||
2254 | debug_atomic_inc(&redundant_softirqs_off); | 2254 | debug_atomic_inc(&redundant_softirqs_off); |
2255 | } | 2255 | } |
2256 | 2256 | ||
2257 | void lockdep_trace_alloc(gfp_t gfp_mask) | 2257 | static void __lockdep_trace_alloc(gfp_t gfp_mask, unsigned long flags) |
2258 | { | 2258 | { |
2259 | struct task_struct *curr = current; | 2259 | struct task_struct *curr = current; |
2260 | 2260 | ||
@@ -2273,12 +2273,29 @@ void lockdep_trace_alloc(gfp_t gfp_mask) | |||
2273 | if (!(gfp_mask & __GFP_FS)) | 2273 | if (!(gfp_mask & __GFP_FS)) |
2274 | return; | 2274 | return; |
2275 | 2275 | ||
2276 | if (DEBUG_LOCKS_WARN_ON(irqs_disabled())) | 2276 | if (DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))) |
2277 | return; | 2277 | return; |
2278 | 2278 | ||
2279 | mark_held_locks(curr, RECLAIM_FS); | 2279 | mark_held_locks(curr, RECLAIM_FS); |
2280 | } | 2280 | } |
2281 | 2281 | ||
2282 | static void check_flags(unsigned long flags); | ||
2283 | |||
2284 | void lockdep_trace_alloc(gfp_t gfp_mask) | ||
2285 | { | ||
2286 | unsigned long flags; | ||
2287 | |||
2288 | if (unlikely(current->lockdep_recursion)) | ||
2289 | return; | ||
2290 | |||
2291 | raw_local_irq_save(flags); | ||
2292 | check_flags(flags); | ||
2293 | current->lockdep_recursion = 1; | ||
2294 | __lockdep_trace_alloc(gfp_mask, flags); | ||
2295 | current->lockdep_recursion = 0; | ||
2296 | raw_local_irq_restore(flags); | ||
2297 | } | ||
2298 | |||
2282 | static int mark_irqflags(struct task_struct *curr, struct held_lock *hlock) | 2299 | static int mark_irqflags(struct task_struct *curr, struct held_lock *hlock) |
2283 | { | 2300 | { |
2284 | /* | 2301 | /* |