lockdep internal warning in linux-next

Previous thread: [bug, 2.6.26-rc4/rc5] sporadic bootup crashes in blk_lookup_devt()/prepare_namespace() by Ingo Molnar on Monday, June 9, 2008 - 1:03 am. (22 messages)

Next thread: [PATCH] sched: Kill off dead cfs_rq_set_shares(). by Paul Mundt on Monday, June 9, 2008 - 1:12 am. (2 messages)
From: Andrew Morton
Date: Monday, June 9, 2008 - 1:09 am

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)
--

From: Ingo Molnar
Date: Monday, June 9, 2008 - 1:39 am

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

	Ingo

----------------->
Subject: sched: sched_clock() lockdep fix
From: Ingo Molnar <mingo@elte.hu>
Date: Thu Jun 05 15:04:17 CEST 2008


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

Reported-and-bisected-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/sched.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux/kernel/sched.c
===================================================================
--- linux.orig/kernel/sched.c
+++ 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;
 }
--

Previous thread: [bug, 2.6.26-rc4/rc5] sporadic bootup crashes in blk_lookup_devt()/prepare_namespace() by Ingo Molnar on Monday, June 9, 2008 - 1:03 am. (22 messages)

Next thread: [PATCH] sched: Kill off dead cfs_rq_set_shares(). by Paul Mundt on Monday, June 9, 2008 - 1:12 am. (2 messages)