History

locking/lockdep: Track number of zapped lock chains

Add a new counter nr_zapped_lock_chains to track the number lock chains that have been removed.

Waiman Long committed 6 years ago

Commit 797b82e1 parent 836bd743 files · +7 −0Browse files

Showing the changes to kernel/locking (3 of 3 files). Show all

Unified · Split

3 files
  1. kernel/locking/lockdep.c +2 −0
  2. kernel/locking/lockdep_internals.h +1 −0
  3. kernel/locking/lockdep_proc.c +4 −0
kernel/locking/lockdep.c+2−0
@@ -2626,6 +2626,7 @@ out_bug: · 2625 unmodified lines
26262626 struct lock_chain lock_chains[MAX_LOCKDEP_CHAINS];
26272627 static DECLARE_BITMAP(lock_chains_in_use, MAX_LOCKDEP_CHAINS);
26282628 static u16 chain_hlocks[MAX_LOCKDEP_CHAIN_HLOCKS];
2629+unsigned long nr_zapped_lock_chains;
26292630 unsigned int nr_chain_hlocks;
26302631
26312632 struct lock_class *lock_chain_get_class(struct lock_chain *chain, int i)
@@ -4797,6 +4798,7 @@ free_lock_chain: · 2165 unmodified lines
47974798 */
47984799 hlist_del_rcu(&chain->entry);
47994800 __set_bit(chain - lock_chains, pf->lock_chains_being_freed);
4801+ nr_zapped_lock_chains++;
48004802 #endif
48014803 }
48024804
kernel/locking/lockdep_internals.h+1−0
@@ -131,6 +131,7 @@ struct lock_class *lock_chain_get_class(struct lock_chain *chain, int i); · 130 unmodified lines
131131
132132 extern unsigned long nr_lock_classes;
133133 extern unsigned long nr_zapped_classes;
134+extern unsigned long nr_zapped_lock_chains;
134135 extern unsigned long nr_list_entries;
135136 long lockdep_next_lockchain(long i);
136137 unsigned long lock_chain_count(void);
kernel/locking/lockdep_proc.c+4−0
@@ -349,6 +349,10 @@ static int lockdep_stats_show(struct seq_file *m, void *v) · 348 unmodified lines
349349 seq_puts(m, "\n");
350350 seq_printf(m, " zapped classes: %11lu\n",
351351 nr_zapped_classes);
352+#ifdef CONFIG_PROVE_LOCKING
353+ seq_printf(m, " zapped lock chains: %11lu\n",
354+ nr_zapped_lock_chains);
355+#endif
352356 return 0;
353357 }
354358