[PATCH][2.6] Fix early __might_sleep() calls

From: Roger Luethi
Date: Mon Oct 06 2003 - 14:53:42 EST


__might_sleep prints warnings only after jiffies wrap (typically after 5
minutes of uptime).

Patch against 2.6 CVS.

Roger

--- linux-2.5/kernel/sched.c.orig 2003-10-06 20:58:47.258167317 +0200
+++ linux-2.5/kernel/sched.c 2003-10-06 21:31:32.676707449 +0200
@@ -2847,7 +2847,7 @@ void __might_sleep(char *file, int line)
static unsigned long prev_jiffy; /* ratelimiting */

if (in_atomic() || irqs_disabled()) {
- if (time_before(jiffies, prev_jiffy + HZ))
+ if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)
return;
prev_jiffy = jiffies;
printk(KERN_ERR "Debug: sleeping function called from invalid"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/