lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <515463D4.60501@linux.vnet.ibm.com>
Date:	Thu, 28 Mar 2013 21:07:56 +0530
From:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To:	Thomas Gleixner <tglx@...utronix.de>
CC:	LKML <linux-kernel@...r.kernel.org>, linux-arch@...r.kernel.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Paul McKenney <paulmck@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>,
	Magnus Damm <magnus.damm@...il.com>,
	Richard Henderson <rth@...ddle.net>,
	Ivan Kokshaysky <ink@...assic.park.msu.ru>,
	Matt Turner <mattst88@...il.com>
Subject: Re: [patch 07/34] alpha: Use generic idle loop

On 03/22/2013 03:23 AM, Thomas Gleixner wrote:
> The core provides a generic idle poll loop.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Cc: Richard Henderson <rth@...ddle.net>
> Cc: Ivan Kokshaysky <ink@...assic.park.msu.ru>
> Cc: Matt Turner <mattst88@...il.com>
> ---
>  arch/alpha/Kconfig          |    1 +
>  arch/alpha/kernel/process.c |   19 -------------------
>  arch/alpha/kernel/smp.c     |    3 +--
>  3 files changed, 2 insertions(+), 21 deletions(-)
> 
> Index: linux-2.6/arch/alpha/Kconfig
> ===================================================================
> --- linux-2.6.orig/arch/alpha/Kconfig
> +++ linux-2.6/arch/alpha/Kconfig
> @@ -17,6 +17,7 @@ config ALPHA
>  	select ARCH_WANT_IPC_PARSE_VERSION
>  	select ARCH_HAVE_NMI_SAFE_CMPXCHG
>  	select GENERIC_SMP_IDLE_THREAD
> +	select GENERIC_IDLE_LOOP
>  	select GENERIC_CMOS_UPDATE
>  	select GENERIC_STRNCPY_FROM_USER
>  	select GENERIC_STRNLEN_USER
> Index: linux-2.6/arch/alpha/kernel/process.c
> ===================================================================
> --- linux-2.6.orig/arch/alpha/kernel/process.c
> +++ linux-2.6/arch/alpha/kernel/process.c
> @@ -46,25 +46,6 @@
>  void (*pm_power_off)(void) = machine_power_off;
>  EXPORT_SYMBOL(pm_power_off);
> 
> -void
> -cpu_idle(void)
> -{
> -	current_thread_info()->status |= TS_POLLING;
> -
> -	while (1) {
> -		/* FIXME -- EV6 and LCA45 know how to power down
> -		   the CPU.  */
> -
> -		rcu_idle_enter();
> -		while (!need_resched())
> -			cpu_relax();
> -
> -		rcu_idle_exit();
> -		schedule_preempt_disabled();
> -	}
> -}
> -
> -

(In all my replies, I'm referring to the code in your v2 on your git
tree, but replying to the corresponding patches in your v1).

So, in alpha, we poll in cpu idle. In the generic implementation in
kernel/cpu/idle.c, arch_cpu_idle() is defined as:

void __weak arch_cpu_idle(void)
{
        cpu_idle_poll();
}

Should it not have been:

void __weak arch_cpu_idle(void)
{
	current_set_polling();
        cpu_idle_poll();
	current_clr_polling();
}

instead?

Regards,
Srivatsa S. Bhat

>  struct halt_info {
>  	int mode;
>  	char *restart_cmd;
> Index: linux-2.6/arch/alpha/kernel/smp.c
> ===================================================================
> --- linux-2.6.orig/arch/alpha/kernel/smp.c
> +++ linux-2.6/arch/alpha/kernel/smp.c
> @@ -167,8 +167,7 @@ smp_callin(void)
>  	      cpuid, current, current->active_mm));
> 
>  	preempt_disable();
> -	/* Do nothing.  */
> -	cpu_idle();
> +	cpu_startup_entry(CPUHP_ONLINE);
>  }
> 
>  /* Wait until hwrpb->txrdy is clear for cpu.  Return -1 on timeout.  */
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ