mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] 2.5.70: add info to spinlock debugging
@ 2003-05-29 12:33 Andreas Mohr
  0 siblings, 0 replies; only message in thread
From: Andreas Mohr @ 2003-05-29 12:33 UTC (permalink / raw)
  To: LKML

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-29 12:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-29 12:33 [PATCH] 2.5.70: add info to spinlock debugging Andreas Mohr

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®