提交 f5d411c9 编写于 作者: F Frederic Weisbecker

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: NFrederic 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>
上级 2ac0d98f
...@@ -31,10 +31,10 @@ enum tick_nohz_mode { ...@@ -31,10 +31,10 @@ enum tick_nohz_mode {
* struct tick_sched - sched tick emulation and no idle tick control/stats * struct tick_sched - sched tick emulation and no idle tick control/stats
* @sched_timer: hrtimer to schedule the periodic tick in high * @sched_timer: hrtimer to schedule the periodic tick in high
* resolution mode * resolution mode
* @idle_tick: Store the last idle tick expiry time when the tick * @last_tick: Store the last tick expiry time when the tick
* timer is modified for idle sleeps. This is necessary * timer is modified for nohz sleeps. This is necessary
* to resume the tick timer operation in the timeline * to resume the tick timer operation in the timeline
* when the CPU returns from idle * when the CPU returns from nohz sleep.
* @tick_stopped: Indicator that the idle tick has been stopped * @tick_stopped: Indicator that the idle tick has been stopped
* @idle_jiffies: jiffies at the entry to idle for idle time accounting * @idle_jiffies: jiffies at the entry to idle for idle time accounting
* @idle_calls: Total number of idle calls * @idle_calls: Total number of idle calls
...@@ -51,7 +51,7 @@ struct tick_sched { ...@@ -51,7 +51,7 @@ struct tick_sched {
struct hrtimer sched_timer; struct hrtimer sched_timer;
unsigned long check_clocks; unsigned long check_clocks;
enum tick_nohz_mode nohz_mode; enum tick_nohz_mode nohz_mode;
ktime_t idle_tick; ktime_t last_tick;
int inidle; int inidle;
int tick_stopped; int tick_stopped;
unsigned long idle_jiffies; unsigned long idle_jiffies;
......
...@@ -400,7 +400,7 @@ static void tick_nohz_stop_sched_tick(struct tick_sched *ts, ktime_t now) ...@@ -400,7 +400,7 @@ static void tick_nohz_stop_sched_tick(struct tick_sched *ts, ktime_t now)
if (!ts->tick_stopped) { if (!ts->tick_stopped) {
select_nohz_load_balancer(1); select_nohz_load_balancer(1);
ts->idle_tick = hrtimer_get_expires(&ts->sched_timer); ts->last_tick = hrtimer_get_expires(&ts->sched_timer);
ts->tick_stopped = 1; ts->tick_stopped = 1;
} }
...@@ -526,7 +526,7 @@ ktime_t tick_nohz_get_sleep_length(void) ...@@ -526,7 +526,7 @@ ktime_t tick_nohz_get_sleep_length(void)
static void tick_nohz_restart(struct tick_sched *ts, ktime_t now) static void tick_nohz_restart(struct tick_sched *ts, ktime_t now)
{ {
hrtimer_cancel(&ts->sched_timer); hrtimer_cancel(&ts->sched_timer);
hrtimer_set_expires(&ts->sched_timer, ts->idle_tick); hrtimer_set_expires(&ts->sched_timer, ts->last_tick);
while (1) { while (1) {
/* Forward the time to expire in the future */ /* Forward the time to expire in the future */
......
...@@ -167,7 +167,7 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now) ...@@ -167,7 +167,7 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now)
{ {
struct tick_sched *ts = tick_get_tick_sched(cpu); struct tick_sched *ts = tick_get_tick_sched(cpu);
P(nohz_mode); P(nohz_mode);
P_ns(idle_tick); P_ns(last_tick);
P(tick_stopped); P(tick_stopped);
P(idle_jiffies); P(idle_jiffies);
P(idle_calls); P(idle_calls);
...@@ -259,7 +259,7 @@ static int timer_list_show(struct seq_file *m, void *v) ...@@ -259,7 +259,7 @@ static int timer_list_show(struct seq_file *m, void *v)
u64 now = ktime_to_ns(ktime_get()); u64 now = ktime_to_ns(ktime_get());
int cpu; int cpu;
SEQ_printf(m, "Timer List Version: v0.6\n"); SEQ_printf(m, "Timer List Version: v0.7\n");
SEQ_printf(m, "HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES); SEQ_printf(m, "HRTIMER_MAX_CLOCK_BASES: %d\n", HRTIMER_MAX_CLOCK_BASES);
SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now); SEQ_printf(m, "now at %Ld nsecs\n", (unsigned long long)now);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册