Skip to content

Commit fcc784b

Browse files
rostedtIngo Molnar
authored andcommitted
locking/lockdep: Do not record IRQ state within lockdep code
While debugging where things were going wrong with mapping enabling/disabling interrupts with the lockdep state and actual real enabling and disabling interrupts, I had to silent the IRQ disabling/enabling in debug_check_no_locks_freed() because it was always showing up as it was called before the splat was. Use raw_local_irq_save/restore() for not only debug_check_no_locks_freed() but for all internal lockdep functions, as they hide useful information about where interrupts were used incorrectly last. Signed-off-by: Steven Rostedt (VMware) <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lkml.kernel.org/lkml/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 03eeafd commit fcc784b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kernel/locking/lockdep.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,11 +1265,11 @@ unsigned long lockdep_count_forward_deps(struct lock_class *class)
12651265
this.parent = NULL;
12661266
this.class = class;
12671267

1268-
local_irq_save(flags);
1268+
raw_local_irq_save(flags);
12691269
arch_spin_lock(&lockdep_lock);
12701270
ret = __lockdep_count_forward_deps(&this);
12711271
arch_spin_unlock(&lockdep_lock);
1272-
local_irq_restore(flags);
1272+
raw_local_irq_restore(flags);
12731273

12741274
return ret;
12751275
}
@@ -1292,11 +1292,11 @@ unsigned long lockdep_count_backward_deps(struct lock_class *class)
12921292
this.parent = NULL;
12931293
this.class = class;
12941294

1295-
local_irq_save(flags);
1295+
raw_local_irq_save(flags);
12961296
arch_spin_lock(&lockdep_lock);
12971297
ret = __lockdep_count_backward_deps(&this);
12981298
arch_spin_unlock(&lockdep_lock);
1299-
local_irq_restore(flags);
1299+
raw_local_irq_restore(flags);
13001300

13011301
return ret;
13021302
}
@@ -4411,7 +4411,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
44114411
if (unlikely(!debug_locks))
44124412
return;
44134413

4414-
local_irq_save(flags);
4414+
raw_local_irq_save(flags);
44154415
for (i = 0; i < curr->lockdep_depth; i++) {
44164416
hlock = curr->held_locks + i;
44174417

@@ -4422,7 +4422,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
44224422
print_freed_lock_bug(curr, mem_from, mem_from + mem_len, hlock);
44234423
break;
44244424
}
4425-
local_irq_restore(flags);
4425+
raw_local_irq_restore(flags);
44264426
}
44274427
EXPORT_SYMBOL_GPL(debug_check_no_locks_freed);
44284428

0 commit comments

Comments
 (0)