summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-07-03 09:25:10 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-04 00:27:07 +0200
commitd730e882a15c38de02b63a063be636b2ff9e9ed1 (patch)
tree89e45dd870d7de3f50b487e87cf0ec1135f912dd /kernel
parent[PATCH] lockdep: annotate skb_queue_head_init (diff)
downloadlinux-d730e882a15c38de02b63a063be636b2ff9e9ed1.tar.xz
linux-d730e882a15c38de02b63a063be636b2ff9e9ed1.zip
[PATCH] lockdep: annotate timer base locks
Split the per-CPU timer base locks up into separate lock classes, because they are used recursively. Has no effect on non-lockdep kernels. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/timer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/timer.c b/kernel/timer.c
index 4dd9a10d67d0..b761898d04c8 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1559,6 +1559,13 @@ asmlinkage long sys_sysinfo(struct sysinfo __user *info)
return 0;
}
+/*
+ * lockdep: we want to track each per-CPU base as a separate lock-class,
+ * but timer-bases are kmalloc()-ed, so we need to attach separate
+ * keys to them:
+ */
+static struct lock_class_key base_lock_keys[NR_CPUS];
+
static int __devinit init_timers_cpu(int cpu)
{
int j;
@@ -1594,6 +1601,8 @@ static int __devinit init_timers_cpu(int cpu)
}
spin_lock_init(&base->lock);
+ lockdep_set_class(&base->lock, base_lock_keys + cpu);
+
for (j = 0; j < TVN_SIZE; j++) {
INIT_LIST_HEAD(base->tv5.vec + j);
INIT_LIST_HEAD(base->tv4.vec + j);