lkml.org 
[lkml]   [2003]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Debug: sleeping function called from invalid context
Dave Jones <davej@redhat.com> wrote:
>
> How spooky. now I got one too, (minus the noise).
>
> Call Trace:
> [<c0120022>] __might_sleep+0x5b/0x5f

It would be useful to know whether this was triggered by in_atomic() or by
irqs_disabled(). We're suspecting the latter.


diff -puN kernel/sched.c~might_sleep-diags kernel/sched.c
--- 25/kernel/sched.c~might_sleep-diags Mon Aug 18 14:09:41 2003
+++ 25-akpm/kernel/sched.c Mon Aug 18 14:11:55 2003
@@ -2795,13 +2795,19 @@ void __might_sleep(char *file, int line)
{
#if defined(in_atomic)
static unsigned long prev_jiffy; /* ratelimiting */
+ char *msg = NULL;

- if (in_atomic() || irqs_disabled()) {
+ if (in_atomic())
+ msg = "in atomic section";
+ else if (irqs_disabled())
+ msg = "with interrupts disabled";
+
+ if (msg) {
if (time_before(jiffies, prev_jiffy + HZ))
return;
prev_jiffy = jiffies;
- printk(KERN_ERR "Debug: sleeping function called from invalid"
- " context at %s:%d\n", file, line);
+ printk(KERN_ERR "Debug: sleeping function "
+ "called %s at %s:%d\n", msg, file, line);
dump_stack();
}
#endif
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.119 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site