From: David Wilder <dwilder@us.ibm.com>
To: linuxppc-dev@ozlabs.org
Subject: [RFC-PATCH] Prevent tasks from sleeping in die()
Date: Wed, 10 May 2006 17:19:34 -0700 [thread overview]
Message-ID: <44628316.80600@us.ibm.com> (raw)
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
next reply other threads:[~2006-05-10 23:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-11 0:19 David Wilder [this message]
2006-05-10 23:45 ` [RFC-PATCH] Prevent tasks from sleeping in die() Paul Mackerras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44628316.80600@us.ibm.com \
--to=dwilder@us.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox