diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 6e283dc7679a..b112caaa400a 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -8226,20 +8226,25 @@ void __might_sleep(char *file, int line) | |||
8226 | #ifdef in_atomic | 8226 | #ifdef in_atomic |
8227 | static unsigned long prev_jiffy; /* ratelimiting */ | 8227 | static unsigned long prev_jiffy; /* ratelimiting */ |
8228 | 8228 | ||
8229 | if ((in_atomic() || irqs_disabled()) && | 8229 | if ((!in_atomic() && !irqs_disabled()) || |
8230 | system_state == SYSTEM_RUNNING && !oops_in_progress) { | 8230 | system_state != SYSTEM_RUNNING || oops_in_progress) |
8231 | if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) | 8231 | return; |
8232 | return; | 8232 | if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) |
8233 | prev_jiffy = jiffies; | 8233 | return; |
8234 | printk(KERN_ERR "BUG: sleeping function called from invalid" | 8234 | prev_jiffy = jiffies; |
8235 | " context at %s:%d\n", file, line); | 8235 | |
8236 | printk("in_atomic():%d, irqs_disabled():%d, pid: %d, name: %s\n", | 8236 | printk(KERN_ERR |
8237 | in_atomic(), irqs_disabled(), current->pid, current->comm); | 8237 | "BUG: sleeping function called from invalid context at %s:%d\n", |
8238 | debug_show_held_locks(current); | 8238 | file, line); |
8239 | if (irqs_disabled()) | 8239 | printk(KERN_ERR |
8240 | print_irqtrace_events(current); | 8240 | "in_atomic(): %d, irqs_disabled(): %d, pid: %d, name: %s\n", |
8241 | dump_stack(); | 8241 | in_atomic(), irqs_disabled(), |
8242 | } | 8242 | current->pid, current->comm); |
8243 | |||
8244 | debug_show_held_locks(current); | ||
8245 | if (irqs_disabled()) | ||
8246 | print_irqtrace_events(current); | ||
8247 | dump_stack(); | ||
8243 | #endif | 8248 | #endif |
8244 | } | 8249 | } |
8245 | EXPORT_SYMBOL(__might_sleep); | 8250 | EXPORT_SYMBOL(__might_sleep); |