From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Triplett Subject: Re: [PATCH tip/core/rcu 15/26] alpha: Fix preemption handling in idle loop Date: Fri, 31 Aug 2012 16:55:46 -0700 Message-ID: <20120831235546.GL11771@jtriplet-mobl1> References: <20120830210520.GA2824@linux.vnet.ibm.com> <1346360743-3628-1-git-send-email-paulmck@linux.vnet.ibm.com> <1346360743-3628-15-git-send-email-paulmck@linux.vnet.ibm.com> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <1346360743-3628-15-git-send-email-paulmck@linux.vnet.ibm.com> Sender: linux-alpha-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, fweisbec@gmail.com, sbw@mit.edu, patches@linaro.org, Richard Henderson , Ivan Kokshaysky , Matt Turner , alpha , Michael Cree On Thu, Aug 30, 2012 at 02:05:32PM -0700, Paul E. McKenney wrote: > From: Frederic Weisbecker > > 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 > Cc: Richard Henderson > Cc: Ivan Kokshaysky > Cc: Matt Turner > Cc: alpha > Cc: Paul E. McKenney > Cc: Michael Cree Reviewed-by: Josh Triplett > 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.8 >