Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=838225b48edc971620cbeb292034dabd2b0d7d1d
Commit:     838225b48edc971620cbeb292034dabd2b0d7d1d
Parent:     4dcf6aff023d9934630fb3649284951831c51f8f
Author:     Satyam Sharma <[EMAIL PROTECTED]>
AuthorDate: Wed Oct 24 18:23:50 2007 +0200
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Oct 24 18:23:50 2007 +0200

    sched: use show_regs() to improve __schedule_bug() output
    
    A full register dump along with stack backtrace would make the
    "scheduling while atomic" message more helpful. Use show_regs() instead
    of dump_stack() for this. We already know we're atomic in here (that is
    why this function was called) so show_regs()'s atomicity expectations
    are guaranteed.
    
    Also, modify the output of the "BUG: scheduling while atomic:" header a
    bit to keep task->comm and task->pid together and preempt_count() after
    them.
    
    Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 kernel/sched.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index af02a4d..d1e6663 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -66,6 +66,7 @@
 #include <linux/pagemap.h>
 
 #include <asm/tlb.h>
+#include <asm/irq_regs.h>
 
 /*
  * Scheduler clock - returns current time in nanosec units.
@@ -3507,12 +3508,19 @@ EXPORT_SYMBOL(sub_preempt_count);
  */
 static noinline void __schedule_bug(struct task_struct *prev)
 {
-       printk(KERN_ERR "BUG: scheduling while atomic: %s/0x%08x/%d\n",
-               prev->comm, preempt_count(), task_pid_nr(prev));
+       struct pt_regs *regs = get_irq_regs();
+
+       printk(KERN_ERR "BUG: scheduling while atomic: %s/%d/0x%08x\n",
+               prev->comm, prev->pid, preempt_count());
+
        debug_show_held_locks(prev);
        if (irqs_disabled())
                print_irqtrace_events(prev);
-       dump_stack();
+
+       if (regs)
+               show_regs(regs);
+       else
+               dump_stack();
 }
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to