Commit f5d411c91ede162240f34e05a233f2759412988e

Authored by Frederic Weisbecker
1 parent 2ac0d98fd6

nohz: Rename ts->idle_tick to ts->last_tick

Now that idle and nohz logics are going to be independant each others,
ts->idle_tick becomes too much a biased name to describe the field that
saves the last scheduled tick on top of which we re-calculate the next
tick to schedule when the timer is restarted.

We want to reuse this even to stop the tick outside idle cases. So let's
rename it to some more generic name: ts->last_tick.

This changes a bit the timer list stat export so we need to increase its
version.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Alessio Igor Bogani <abogani@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Avi Kivity <avi@redhat.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Gilad Ben Yossef <gilad@benyossef.com>
Cc: Hakan Akkan <hakanakkan@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Max Krasnyansky <maxk@qualcomm.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Sven-Thorsten Dietrich <thebigcorporation@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>

Showing 3 changed files with 8 additions and 8 deletions Side-by-side Diff

include/linux/tick.h
... ... @@ -31,10 +31,10 @@
31 31 * struct tick_sched - sched tick emulation and no idle tick control/stats
32 32 * @sched_timer: hrtimer to schedule the periodic tick in high
33 33 * resolution mode
34   - * @idle_tick: Store the last idle tick expiry time when the tick
35   - * timer is modified for idle sleeps. This is necessary
  34 + * @last_tick: Store the last tick expiry time when the tick
  35 + * timer is modified for nohz sleeps. This is necessary
36 36 * to resume the tick timer operation in the timeline
37   - * when the CPU returns from idle
  37 + * when the CPU returns from nohz sleep.
38 38 * @tick_stopped: Indicator that the idle tick has been stopped
39 39 * @idle_jiffies: jiffies at the entry to idle for idle time accounting
40 40 * @idle_calls: Total number of idle calls
... ... @@ -51,7 +51,7 @@
51 51 struct hrtimer sched_timer;
52 52 unsigned long check_clocks;
53 53 enum tick_nohz_mode nohz_mode;
54   - ktime_t idle_tick;
  54 + ktime_t last_tick;
55 55 int inidle;
56 56 int tick_stopped;
57 57 unsigned long idle_jiffies;
kernel/time/tick-sched.c
... ... @@ -400,7 +400,7 @@
400 400 if (!ts->tick_stopped) {
401 401 select_nohz_load_balancer(1);
402 402  
403   - ts->idle_tick = hrtimer_get_expires(&ts->sched_timer);
  403 + ts->last_tick = hrtimer_get_expires(&ts->sched_timer);
404 404 ts->tick_stopped = 1;
405 405 }
406 406  
... ... @@ -526,7 +526,7 @@
526 526 static void tick_nohz_restart(struct tick_sched *ts, ktime_t now)
527 527 {
528 528 hrtimer_cancel(&ts->sched_timer);
529   - hrtimer_set_expires(&ts->sched_timer, ts->idle_tick);
  529 + hrtimer_set_expires(&ts->sched_timer, ts->last_tick);
530 530  
531 531 while (1) {
532 532 /* Forward the time to expire in the future */
kernel/time/timer_list.c
... ... @@ -167,7 +167,7 @@
167 167 {
168 168 struct tick_sched *ts = tick_get_tick_sched(cpu);
169 169 P(nohz_mode);
170   - P_ns(idle_tick);
  170 + P_ns(last_tick);
171 171 P(tick_stopped);
172 172 P(idle_jiffies);
173 173 P(idle_calls);
... ... @@ -259,7 +259,7 @@
259 259 u64 now = ktime_to_ns(ktime_get());
260 260 int cpu;
261 261  
262   - SEQ_printf(m, "Timer List Version: v0.6\n");
  262 + SEQ_printf(m, "Timer List Version: v0.7\n");
263 263 SEQ_printf(m, "HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES);
264 264 SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now);
265 265