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: <20070611002614.GA20676@linux-sh.org>
Date:	Mon, 11 Jun 2007 09:26:14 +0900
From:	Paul Mundt <lethal@...ux-sh.org>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>, Andrew Morton <akpm@...l.org>,
	Ingo Molnar <mingo@...e.hu>, Andi Kleen <ak@...e.de>,
	Arjan van de Ven <arjan@...radead.org>,
	Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>,
	Chris Wright <chrisw@...s-sol.org>,
	Adam Belay <abelay@...ell.com>, Len Brown <lenb@...nel.org>,
	Dave Miller <davem@...emloft.net>,
	Russell King <rmk+kernel@....linux.org.uk>
Subject: Re: [patch-mm 01/23] NOHZ: Fix ARM,SH,SPARC64 idle nohz handling

On Sun, Jun 10, 2007 at 09:43:59AM -0000, Thomas Gleixner wrote:
> Index: linux-2.6.22-rc4-mm/arch/sh/kernel/process.c
> ===================================================================
> --- linux-2.6.22-rc4-mm.orig/arch/sh/kernel/process.c	2007-06-10 10:44:38.000000000 +0200
> +++ linux-2.6.22-rc4-mm/arch/sh/kernel/process.c	2007-06-10 10:44:38.000000000 +0200
> @@ -62,8 +62,10 @@ void default_idle(void)
>  		clear_thread_flag(TIF_POLLING_NRFLAG);
>  		smp_mb__after_clear_bit();
>  		set_bl_bit();
> -		while (!need_resched())
> +		while (!need_resched()) {
> +			tick_nohz_stop_sched_tick();
>  			cpu_sleep();
> +		}
>  		clear_bl_bit();
>  		set_thread_flag(TIF_POLLING_NRFLAG);
>  	} else
> @@ -82,7 +84,6 @@ void cpu_idle(void)
>  		if (!idle)
>  			idle = default_idle;
>  
> -		tick_nohz_stop_sched_tick();
>  		while (!need_resched())
>  			idle();
>  		tick_nohz_restart_sched_tick();

There are two paths here depending on hlt/nohlt setting, we need to have
tick_nohz_stop_sched_tick() for the TIF_POLLING_NRFLAG case, too.

Signed-off-by: Paul Mundt <lethal@...ux-sh.org>

--

diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index a11e2aa..42e156b 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -62,13 +62,17 @@ void default_idle(void)
 		clear_thread_flag(TIF_POLLING_NRFLAG);
 		smp_mb__after_clear_bit();
 		set_bl_bit();
-		while (!need_resched())
+		while (!need_resched()) {
+			tick_nohz_stop_sched_tick();
 			cpu_sleep();
+		}
 		clear_bl_bit();
 		set_thread_flag(TIF_POLLING_NRFLAG);
 	} else
-		while (!need_resched())
+		while (!need_resched()) {
+			tick_nohz_stop_sched_tick();
 			cpu_relax();
+		}
 }
 
 void cpu_idle(void)
@@ -82,7 +86,6 @@ void cpu_idle(void)
 		if (!idle)
 			idle = default_idle;
 
-		tick_nohz_stop_sched_tick();
 		while (!need_resched())
 			idle();
 		tick_nohz_restart_sched_tick();
-
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