From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Linux Kernel List <linux-kernel@vger.kernel.org>
Cc: Arjan Van de Ven <arjan@infradead.org>, Ingo Molnar <mingo@elte.hu>
Subject: lockdep: results on ARM
Date: Thu, 27 Jul 2006 15:24:25 +0100 [thread overview]
Message-ID: <20060727142425.GA5178@flint.arm.linux.org.uk> (raw)
Hi,
I've been working on getting lockdep up and running on ARM, and have hit
a problem wrt our context switching with IRQs enabled.
I'm seeing:
Calibrating local timer... 104.40MHz.
BUG: warning at /home/rmk/git/linux-2.6-rmk/kernel/lockdep.c:2343/check_flags()
[<c0024ed0>] (dump_stack+0x0/0x14) from [<c005cf20>] (check_flags+0x88/0x1e4)
[<c005ce98>] (check_flags+0x0/0x1e4) from [<c005d0c4>] (lock_acquire+0x48/0x94)
r5 = C05D4000 r4 = 60000013
[<c005d07c>] (lock_acquire+0x0/0x94) from [<c01e0f70>] (_spin_lock+0x30/0x40)
[<c01e0f40>] (_spin_lock+0x0/0x40) from [<c0041e5c>] (exit_fs+0x28/0xbc)
r4 = C05CD26C
[<c0041e34>] (exit_fs+0x0/0xbc) from [<c0055900>] (kthread+0x2c/0x110)
r6 = C021F520 r5 = C05CD040 r4 = C05D4000
[<c00558d4>] (kthread+0x0/0x110) from [<c00423b8>] (do_exit+0x0/0x83c)
r8 = 00000000 r7 = 00000000 r6 = 00000000 r5 = 00000000
r4 = 00000000
irq event stamp: 0
hardirqs last enabled at (0): [<00000000>] 0x0
hardirqs last disabled at (0): [<c003d918>] copy_process+0x31c/0x1274
softirqs last enabled at (0): [<c003d918>] copy_process+0x31c/0x1274
softirqs last disabled at (0): [<00000000>] 0x0
CPU1: Booted secondary processor
which appears to be the lockdep code complaining that IRQs are on when
it thinks they shouldn't be.
Since new processes are created with the lockdep irq state marked as
"disabled", and the scheduler does not change IRQ state if an architecture
sets __ARCH_WANT_INTERRUPTS_ON_CTXSW, there is nothing which causes
lockdep to think IRQs should be on. Moreover, trying to call the
trace_hardirqs_on() function doesn't work because it then bitches that
IRQs are already on.
The best fix I've come up with which seems to work is:
diff --git a/kernel/fork.c b/kernel/fork.c
index 1b0f7b1..bc8cda2 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1055,7 +1055,11 @@ #ifdef CONFIG_NUMA
#endif
#ifdef CONFIG_TRACE_IRQFLAGS
p->irq_events = 0;
+#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
+ p->hardirqs_enabled = 1;
+#else
p->hardirqs_enabled = 0;
+#endif
p->hardirq_enable_ip = 0;
p->hardirq_enable_event = 0;
p->hardirq_disable_ip = _THIS_IP_;
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next reply other threads:[~2006-07-27 14:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-27 14:24 Russell King [this message]
2006-07-27 14:23 ` lockdep: results on ARM Ingo Molnar
2006-07-27 14:32 ` Arjan van de Ven
2006-07-27 20:46 ` H. Peter Anvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060727142425.GA5178@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox