From: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
To: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] 2.5.70: add info to spinlock debugging
Date: Thu, 29 May 2003 14:33:33 +0200 [thread overview]
Message-ID: <20030529123333.GA28193@rhlx01.fht-esslingen.de> (raw)
Hi all,
- directly print out in_atomic() and irqs_disabled() values to ease debugging
- add comment from original patch submission in order to be able to actually
know what this is all about...
Not sure whether that's an absolutely brilliant idea, but I think it's
useful.
Patch against vanilla 2.5.70.
Andreas Mohr
diff -urN linux-2.5.70.orig/kernel/sched.c linux-2.5.70/kernel/sched.c
--- linux-2.5.70.orig/kernel/sched.c 2003-05-28 17:59:02.000000000 +0200
+++ linux-2.5.70/kernel/sched.c 2003-05-28 17:52:21.000000000 +0200
@@ -2512,6 +2512,11 @@
}
#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
+/*
+ * Detect sleep-inside-spinlock bugs. It prints out a whiny
+ * message and a stack backtrace if someone calls a function which might
+ * sleep from within an atomic region.
+ */
void __might_sleep(char *file, int line)
{
#if defined(in_atomic)
@@ -2522,7 +2527,7 @@
return;
prev_jiffy = jiffies;
printk(KERN_ERR "Debug: sleeping function called from illegal"
- " context at %s:%d\n", file, line);
+ " context at %s:%d (in_atomic %d, irq_disabled %d)\n", file, line, in_atomic(), irqs_disabled());
dump_stack();
}
#endif
--
Help prevent Information Technology Fascism! - before it's too late...
http://www.againsttcpa.com
reply other threads:[~2003-05-29 12:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20030529123333.GA28193@rhlx01.fht-esslingen.de \
--to=andi@rhlx01.fht-esslingen.de \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®