Skip to contentSkip to conversation

nohz: Track last do_timer() cpu

tip:timers/core tip-bot for Thomas Gleixner 1 participant 1 message Nov 13, 2009 Nohz, dynticks support

lore
Share & tools
lore
#0 lore raw
Commit-ID:  27185016b806d5a1181ff501cae120582b2b27dd
Gitweb:     http://git.kernel.org/tip/27185016b806d5a1181ff501cae120582b2b27dd
Author:     Thomas Gleixner <[email protected]>
AuthorDate: Thu, 12 Nov 2009 22:12:06 +0100
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Fri, 13 Nov 2009 20:46:24 +0100

nohz: Track last do_timer() cpu

The previous patch which limits the sleep time to the maximum deferment time of the time keeping clocksource has some limitations on SMP machines: if all CPUs are idle then for all CPUs the maximum sleep time is limited.

Solve this by keeping track of which cpu had the do_timer() duty assigned last and limit the sleep time only for this cpu.

LKML-Reference: <new-submission>
Cc: Jon Hunter <[email protected]>
Cc: John Stultz <[email protected]>

---
 include/linux/tick.h     |    2 +
 kernel/time/tick-sched.c |   52 ++++++++++++++++++++++++---------------------
 2 files changed, 30 insertions(+), 24 deletions(-)
include/linux/tick.h +2 -0
index 8dc0821..d2ae79e 100644
@@ -43,6 +43,7 @@ enum tick_nohz_mode {
  * @idle_exittime:	Time when the idle state was left
  * @idle_sleeptime:	Sum of the time slept in idle with sched tick stopped
  * @sleep_length:	Duration of the current idle sleep
+ * @do_timer_lst:	CPU was the last one doing do_timer before going idle
  */
 struct tick_sched {
 	struct hrtimer			sched_timer;
@@ -64,6 +65,7 @@ struct tick_sched {
 	unsigned long			last_jiffies;
 	unsigned long			next_jiffies;
 	ktime_t				idle_expires;
+	int				do_timer_last;
 };
 
 extern void __init tick_init(void);
kernel/time/tick-sched.c +28 -24

72 lines not on this page · raw message