Prevent tasks from sleeping in die()
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 <[email protected]>
arch/powerpc/kernel/traps.c +9 -0
@@ -101,6 +101,15 @@ int die(const char *str, struct pt_regsif (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 );
Signature · 4 lines
David Wilder IBM Linux Technology Center Beaverton, Oregon, USA [email protected] (503)578-3789
Quoted 3 lines · David Wilder
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.