[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-alpha
Subject:    Re: [PATCH tip/core/rcu 15/26] alpha: Fix preemption handling in idle loop
From:       Josh Triplett <josh () joshtriplett ! org>
Date:       2012-08-31 23:55:46
Message-ID: 20120831235546.GL11771 () jtriplet-mobl1
[Download RAW message or body]

On Thu, Aug 30, 2012 at 02:05:32PM -0700, Paul E. McKenney wrote:
> From: Frederic Weisbecker <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>

Reviewed-by: Josh Triplett <josh@joshtriplett.org>

>  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
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-alpha" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic