[patch 2/2] fix idle loop for offline cpu

Joel Schopp jschopp at austin.ibm.com
Thu Aug 12 04:30:59 EST 2004


iSeries is not cpu DLPAR capable in Linux.  The "i5" machine itself is,
but it is not supported by #define CONFIG_PPC_ISERIES.  You actually run
the pSeries Linux on it.  Because of this I think it is wasteful to
check cpu_is_offline here.

Other than that I think both patches are great.

> diff -puN arch/ppc64/kernel/idle.c~ppc64-fix-idle-loop-for-offline-cpu arch/ppc64/kernel/idle.c
> --- 2.6.8-rc4/arch/ppc64/kernel/idle.c~ppc64-fix-idle-loop-for-offline-cpu	2004-08-11 10:44:29.000000000 -0500
> +++ 2.6.8-rc4-nathanl/arch/ppc64/kernel/idle.c	2004-08-11 10:44:29.000000000 -0500
> @@ -132,6 +132,7 @@ int iSeries_idle(void)
>  int default_idle(void)
>  {
>  	long oldval;
> +	unsigned int cpu = smp_processor_id();
>
>  	while (1) {
>  		oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED);
> @@ -139,7 +140,7 @@ int default_idle(void)
>  		if (!oldval) {
>  			set_thread_flag(TIF_POLLING_NRFLAG);
>
> -			while (!need_resched()) {
> +			while (!need_resched() && !cpu_is_offline(cpu)) {
>  				barrier();
>  				HMT_low();
>  			}
> @@ -151,8 +152,7 @@ int default_idle(void)
>  		}
>
>  		schedule();
> -		if (cpu_is_offline(smp_processor_id()) &&
> -				system_state == SYSTEM_RUNNING)
> +		if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
>  			cpu_die();
>  	}
>

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list