linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: idle: Avoid retaining the tick when it has been stopped
@ 2018-08-09 17:08 Rafael J. Wysocki
  2018-08-10  6:19 ` leo.yan
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Rafael J. Wysocki @ 2018-08-09 17:08 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Linux PM, LKML, Frederic Weisbecker, Ingo Molnar, Leo Yan

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

If the tick has been stopped already, but the governor has not asked to
stop it (which it can do sometimes), the idle loop should invoke
tick_nohz_idle_stop_tick(), to let tick_nohz_stop_tick() take care
of this case properly.

Fixes: 554c8aa8ecad (sched: idle: Select idle state before stopping the tick)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 kernel/sched/idle.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-pm/kernel/sched/idle.c
===================================================================
--- linux-pm.orig/kernel/sched/idle.c
+++ linux-pm/kernel/sched/idle.c
@@ -190,7 +190,7 @@ static void cpuidle_idle_call(void)
 		 */
 		next_state = cpuidle_select(drv, dev, &stop_tick);
 
-		if (stop_tick)
+		if (stop_tick || tick_nohz_tick_stopped())
 			tick_nohz_idle_stop_tick();
 		else
 			tick_nohz_idle_retain_tick();


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-08-21 23:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-09 17:08 [PATCH] sched: idle: Avoid retaining the tick when it has been stopped Rafael J. Wysocki
2018-08-10  6:19 ` leo.yan
2018-08-10  7:15   ` Rafael J. Wysocki
2018-08-16 13:27 ` Frederic Weisbecker
2018-08-17  9:32   ` Rafael J. Wysocki
2018-08-17 10:05     ` Rafael J. Wysocki
2018-08-17 14:12     ` Frederic Weisbecker
2018-08-18 21:57       ` Rafael J. Wysocki
2018-08-19  0:36         ` leo.yan
2018-08-19  7:57           ` Rafael J. Wysocki
2018-08-20  9:14         ` Peter Zijlstra
2018-08-20 14:42         ` Frederic Weisbecker
2018-08-20 21:21           ` Rafael J. Wysocki
2018-08-21 23:21 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).