Skip to contentSkip to conversation

lockdep internal warning in linux-next

DISCUSSION Andrew Morton 2 participants 2 messages Jun 9, 2008

lore
Share & tools
lore
#0 lore raw

When I boot the 2-way using
http://userweb.kernel.org/~akpm/config-vmm.txt

I see:

Write protecting the kernel text: 2872k Write protecting the kernel read-only data: 1012k hostname used greatest stack depth: 6808 bytes left mount used greatest stack depth: 6048 bytes left hotplug used greatest stack depth: 5568 bytes left

------------[ cut here ]------------
WARNING: at kernel/lockdep.c:2680 check_flags+0x162/0x180()
Modules linked in:
Pid: 5, comm: watchdog/0 Not tainted 2.6.26-rc5 #3
 [<c0123484>] warn_on_slowpath+0x54/0x70
 [<c0141e3b>] ? trace_hardirqs_on+0xb/0x10
 [<c0141da4>] ? trace_hardirqs_on_caller+0xd4/0x160
 [<c0141e3b>] ? trace_hardirqs_on+0xb/0x10
 [<c03cc062>] ? _spin_unlock_irq+0x22/0x30
 [<c013b5bc>] ? sched_clock_cpu+0xbc/0x140
 [<c013f992>] check_flags+0x162/0x180
 [<c0143329>] lock_acquire+0x39/0xa0
 [<c03cbeac>] _read_lock+0x2c/0x40
 [<c0156ec1>] ? watchdog+0xb1/0x1d0
 [<c0156ec1>] watchdog+0xb1/0x1d0
 [<c011a0f6>] ? complete+0x46/0x60
 [<c0156e10>] ? watchdog+0x0/0x1d0
 [<c0136632>] kthread+0x42/0x70
 [<c01365f0>] ? kthread+0x0/0x70
 [<c0103ba3>] kernel_thread_helper+0x7/0x14
 =======================
---[ end trace 8151399cdd960ac9 ]---
possible reason: unannotated irqs-on.
irq event stamp: 14
hardirqs last  enabled at (13): [<c0141e3b>] trace_hardirqs_on+0xb/0x10
hardirqs last disabled at (14): [<c01403eb>] trace_hardirqs_off+0xb/0x10
softirqs last  enabled at (0): [<c0121a8c>] copy_process+0x27c/0x10b0
softirqs last disabled at (0): [<00000000>] 0x0

EXT3 FS on hdc2, internal journal
Adding 1020116k swap on /dev/hdc3. Priority:-1 extents:1 across:1020116k

(but at least it all boots and runs - small blessings)

#1 lore raw
Quoted 2 lines · Andrew Morton

When I boot the 2-way using
http://userweb.kernel.org/~akpm/config-vmm.txt

this is probably the same as the known problem fixed by the patch below.

Ingo

----------------->
Subject: sched: sched_clock() lockdep fix
From: Ingo Molnar <[email protected]>
Date: Thu Jun 05 15:04:17 CEST 2008

Sitsofe Wheeler reported a lockdep warning and bisected it down to:

Quoted 5 lines

commit c6531cce6e6e4b99bcda46b6268d6f2d9e30aea4

Author: Ingo Molnar <[email protected]>
Date:   Mon May 12 21:21:14 2008 +0200

sched: do not trace sched_clock

do not use raw irq flags in cpu_clock() as it causes lockdep to lose track of the true state of the IRQ flag.

---
 kernel/sched.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched.c +2 -2
Index: linux/kernel/sched.c
===================================================================
@@ -862,7 +862,7 @@ unsigned long long notrace cpu_clock(int
 	unsigned long long prev_cpu_time, time, delta_time;
 	unsigned long flags;
 
-	raw_local_irq_save(flags);
+	local_irq_save(flags);
 	prev_cpu_time = per_cpu(prev_cpu_time, cpu);
 	time = __cpu_clock(cpu) + per_cpu(time_offset, cpu);
 	delta_time = time-prev_cpu_time;
@@ -871,7 +871,7 @@ unsigned long long notrace cpu_clock(int
 		time = __sync_cpu_clock(time, cpu);
 		per_cpu(prev_cpu_time, cpu) = time;
 	}
-	raw_local_irq_restore(flags);
+	local_irq_restore(flags);
 
 	return time;
 }