LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [RFC-PATCH] Prevent tasks from sleeping in die()
  2006-05-11  0:19 [RFC-PATCH] Prevent tasks from sleeping in die() David Wilder
@ 2006-05-10 23:45 ` Paul Mackerras
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Mackerras @ 2006-05-10 23:45 UTC (permalink / raw)
  To: David Wilder; +Cc: linuxppc-dev

David Wilder writes:

> I am seeing an issue in die() when voluntary preemption is enabled.
> die() 
> ->>show_regs()->>show_instructions()->>__get_user_nocheck()->>might_sleep()

Are you using Linus' current git tree?  It has a patch that fixes this
problem by making __get_user_nocheck do the might_sleep only if the
address you give it is a user address.

Paul.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [RFC-PATCH] Prevent tasks from sleeping in die()
@ 2006-05-11  0:19 David Wilder
  2006-05-10 23:45 ` Paul Mackerras
  0 siblings, 1 reply; 2+ messages in thread
From: David Wilder @ 2006-05-11  0:19 UTC (permalink / raw)
  To: linuxppc-dev

I am seeing an issue in die() when voluntary preemption is enabled.
die() 
->>show_regs()->>show_instructions()->>__get_user_nocheck()->>might_sleep()
If multiple CPUs call die() and one should sleep other CPUs may block on 
the die_lock held by the sleeping CPU.  This problem is seen when a 
soft-reset is issued as all CPUs call die() at roughly the same time.

Is this the correct way to fix this problem?

Signed-of-by: <wilder@us.ibm.com>

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 064a525..dc45bcd 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -101,6 +101,15 @@ int die(const char *str, struct pt_regs
    if (debugger(regs))
        return 1;

+    /* If voluntary preemption is on we can sleep
+     * in show_regs().  This is bad as we hold the
+    * die_lock. Ether the task is exiting or the system
+    * is crashing so there is no need to restore the
+    * NEED_RESCHED flag.
+    */
+    clear_need_resched();
+
+
        console_verbose();
        spin_lock_irq(&die_lock);
        bust_spinlocks(1);

-- 
David Wilder
IBM Linux Technology Center
Beaverton, Oregon, USA 
dwilder@us.ibm.com
(503)578-3789

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-10 23:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-11  0:19 [RFC-PATCH] Prevent tasks from sleeping in die() David Wilder
2006-05-10 23:45 ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox