From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Richard Henderson <rth@twiddle.net>,
Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
Matt Turner <mattst88@gmail.com>,
alpha <linux-alpha@vger.kernel.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Michael Cree <mcree@orcon.net.nz>
Subject: [PATCH 01/11] alpha: Fix preemption handling in idle loop
Date: Thu, 23 Aug 2012 16:58:25 +0200 [thread overview]
Message-ID: <1345733915-20040-2-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1345733915-20040-1-git-send-email-fweisbec@gmail.com>
cpu_idle() is called on the boot CPU by the init code with
preemption disabled. But the cpu_idle() function in alpha
doesn't handle this when it calls schedule() directly.
Fix it by converting it into schedule_preempt_disabled().
Also disable preemption before calling cpu_idle() from
secondary CPU entry code to stay consistent with this
state.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Richard Henderson<rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: alpha <linux-alpha@vger.kernel.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Michael Cree <mcree@orcon.net.nz>
---
arch/alpha/kernel/process.c | 3 ++-
arch/alpha/kernel/smp.c | 1 +
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 153d3fc..eac5e01 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -56,7 +56,8 @@ cpu_idle(void)
while (!need_resched())
cpu_relax();
- schedule();
+
+ schedule_preempt_disabled();
}
}
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 35ddc02..a41ad90 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -166,6 +166,7 @@ smp_callin(void)
DBGS(("smp_callin: commencing CPU %d current %p active_mm %p\n",
cpuid, current, current->active_mm));
+ preempt_disable();
/* Do nothing. */
cpu_idle();
}
--
1.7.5.4
next prev parent reply other threads:[~2012-08-23 14:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-23 14:58 [PATCH 00/11] rcu: Add missing RCU idle APIs on idle loop v2 Frederic Weisbecker
2012-08-23 14:58 ` Frederic Weisbecker [this message]
2012-08-23 14:58 ` [PATCH 02/11] alpha: Add missing RCU idle APIs on idle loop Frederic Weisbecker
2012-08-24 21:26 ` [PATCH 00/11] rcu: Add missing RCU idle APIs on idle loop v2 Paul E. McKenney
2012-08-25 1:19 ` Ben Hutchings
2012-08-25 2:10 ` Michael Cree
2012-08-25 3:50 ` Paul E. McKenney
2012-08-25 13:16 ` Frederic Weisbecker
2012-08-25 16:18 ` Paul E. McKenney
2012-08-25 21:15 ` Michael Cree
2012-08-26 0:12 ` Paul E. McKenney
2012-08-26 9:21 ` Tobias Klausmann
2012-09-10 21:53 ` Frederic Weisbecker
2012-09-12 18:01 ` Tobias Klausmann
2012-09-10 21:56 ` Frederic Weisbecker
2012-09-10 22:58 ` Paul E. McKenney
2012-09-11 12:35 ` Frederic Weisbecker
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=1345733915-20040-2-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=ink@jurassic.park.msu.ru \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mattst88@gmail.com \
--cc=mcree@orcon.net.nz \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rth@twiddle.net \
/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;
as well as URLs for NNTP newsgroup(s).