]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix early __might_sleep() calls
authorAndrew Morton <akpm@osdl.org>
Thu, 16 Oct 2003 00:30:11 +0000 (17:30 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Thu, 16 Oct 2003 00:30:11 +0000 (17:30 -0700)
From: Roger Luethi <rl@hellgate.ch>

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

kernel/sched.c

index 3b83f89088ea5d66e2b3cc75d114a8f70da730b7..afdac563aed8af6286a05071203f6b9a0c4e8360 100644 (file)
@@ -2849,7 +2849,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"