aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-08-28 05:34:43 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-28 05:36:03 -0400
commitaef745fca016aea45adae5c98e8698904dd8ad51 (patch)
treefc5278fc828ba274ab8c5f8382345113ef14277c /kernel/sched.c
parent29cbef4869bf288256ab76c7dc674cb132b35de2 (diff)
sched: clean up __might_sleep()
add KERN_ to the printout and clean up the flow a bit. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c33
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}
8245EXPORT_SYMBOL(__might_sleep); 8250EXPORT_SYMBOL(__might_sleep);