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: <5154651A.6010304@linux.vnet.ibm.com>
Date:	Thu, 28 Mar 2013 21:13:22 +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>, x86@...nel.org
Subject: Re: [patch 33/34] x86: Use generic idle loop

On 03/22/2013 03:23 AM, Thomas Gleixner wrote:
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Cc: x86@...nel.org
> ---
[...]
> +#define POLL_IDLE	(void*) 0x01
> +

[...]

>  #ifdef CONFIG_APM_MODULE
> @@ -411,20 +376,6 @@ void stop_this_cpu(void *dummy)
>  		halt();
>  }
> 
> -/*
> - * On SMP it's slightly faster (but much more power-consuming!)
> - * to poll the ->work.need_resched flag instead of waiting for the
> - * cross-CPU IPI to arrive. Use this option with caution.
> - */
> -static void poll_idle(void)
> -{
> -	trace_cpu_idle_rcuidle(0, smp_processor_id());
> -	local_irq_enable();
> -	while (!need_resched())
> -		cpu_relax();
> -	trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
> -}
> -
>  bool amd_e400_c1e_detected;
>  EXPORT_SYMBOL(amd_e400_c1e_detected);
> 
> @@ -489,7 +440,7 @@ static void amd_e400_idle(void)
>  void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
>  {
>  #ifdef CONFIG_SMP
> -	if (x86_idle == poll_idle && smp_num_siblings > 1)
> +	if (x86_idle == POLL_IDLE && smp_num_siblings > 1)
>  		pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n");
>  #endif
>  	if (x86_idle)
> @@ -517,8 +468,9 @@ static int __init idle_setup(char *str)
> 
>  	if (!strcmp(str, "poll")) {
>  		pr_info("using polling idle threads\n");
> -		x86_idle = poll_idle;
> +		x86_idle = POLL_IDLE;
>  		boot_option_idle_override = IDLE_POLL;
> +		cpu_idle_poll_ctrl(true);

Why is that POLL_IDLE needed? Won't cpu_idle_poll_ctrl() suffice?

By the way, booting with idle=poll locks up the kernel during boot with
this patch applied (I verified it). So I think we should just skip the
whole POLL_IDLE thing and leave the job to cpu_idle_poll_ctrl().

 
Regards,
Srivatsa S. Bhat

--
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