Skip to contentSkip to conversation

lockdep: core, reduce per-lock class-cache size

PATCH New Ingo Molnar 1 participant 1 message Jul 5, 2006 Locking primitives

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lockdep: core, reduce per-lock class-cache size

Subject: lockdep: core, reduce per-lock class-cache size
From: Ingo Molnar <[email protected]>

lockdep_map is embedded into every lock, which blows up data structure sizes all around the kernel. Reduce the class-cache to be for the default class only - that is used in 99.9% of the cases and even if we dont have a class cached, the lookup in the class-hash is lockless.

this change reduces the per-lock dep_map overhead by 56 bytes on 64-bit platforms and by 28 bytes on 32-bit platforms.

---
 include/linux/lockdep.h |    2 -
 kernel/lockdep.c        |   87 +++++++++++++++++++++++++++++-------------------
 2 files changed, 55 insertions(+), 34 deletions(-)
include/linux/lockdep.h +1 -1
Index: linux/include/linux/lockdep.h
===================================================================
@@ -120,7 +120,7 @@ struct lock_class {
  */
 struct lockdep_map {
 	struct lock_class_key		*key;
-	struct lock_class		*class[MAX_LOCKDEP_SUBCLASSES];
+	struct lock_class		*class_cache;
 	const char			*name;
 };
 
kernel/lockdep.c +54 -33

153 lines not on this page · raw message