* [PATCH 1/2] nohz: Drop useless call in tick_nohz_start_idle()
@ 2011-07-21 18:49 Frederic Weisbecker
2011-07-21 18:49 ` [PATCH 2/2] nohz: Drop ts->idle_active Frederic Weisbecker
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2011-07-21 18:49 UTC (permalink / raw)
To: LKML; +Cc: Frederic Weisbecker, Ingo Molnar, Thomas Gleixner, Peter Zijlstra
The call to update_ts_time_stats() there is useless. All
we need is to save the idle entry_time.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
kernel/time/tick-sched.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index d5097c4..58e1a96 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -185,9 +185,6 @@ static ktime_t tick_nohz_start_idle(int cpu, struct tick_sched *ts)
ktime_t now;
now = ktime_get();
-
- update_ts_time_stats(cpu, ts, now, NULL);
-
ts->idle_entrytime = now;
ts->idle_active = 1;
sched_clock_idle_sleep_event();
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] nohz: Drop ts->idle_active
2011-07-21 18:49 [PATCH 1/2] nohz: Drop useless call in tick_nohz_start_idle() Frederic Weisbecker
@ 2011-07-21 18:49 ` Frederic Weisbecker
2011-07-25 21:14 ` [PATCH 3/2] nohz: Drop useless ts->inidle check before rearming the tick Frederic Weisbecker
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2011-07-21 18:49 UTC (permalink / raw)
To: LKML; +Cc: Frederic Weisbecker, Ingo Molnar, Thomas Gleixner, Peter Zijlstra
ts->idle_active is used to know if we want to account the idle sleep
time. But ts->inidle is enough to check that.
So drop that field and use inidle instead. This simplifies the code.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/tick.h | 1 -
kernel/time/tick-sched.c | 14 ++++++--------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/include/linux/tick.h b/include/linux/tick.h
index b232ccc..532e650 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -56,7 +56,6 @@ struct tick_sched {
unsigned long idle_jiffies;
unsigned long idle_calls;
unsigned long idle_sleeps;
- int idle_active;
ktime_t idle_entrytime;
ktime_t idle_waketime;
ktime_t idle_exittime;
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 58e1a96..c4d7113 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -157,7 +157,7 @@ update_ts_time_stats(int cpu, struct tick_sched *ts, ktime_t now, u64 *last_upda
{
ktime_t delta;
- if (ts->idle_active) {
+ if (ts->inidle) {
delta = ktime_sub(now, ts->idle_entrytime);
ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta);
if (nr_iowait_cpu(cpu) > 0)
@@ -175,7 +175,6 @@ static void tick_nohz_stop_idle(int cpu, ktime_t now)
struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
update_ts_time_stats(cpu, ts, now, NULL);
- ts->idle_active = 0;
sched_clock_idle_wakeup_event(0);
}
@@ -186,7 +185,6 @@ static ktime_t tick_nohz_start_idle(int cpu, struct tick_sched *ts)
now = ktime_get();
ts->idle_entrytime = now;
- ts->idle_active = 1;
sched_clock_idle_sleep_event();
return now;
}
@@ -502,11 +500,11 @@ void tick_nohz_restart_sched_tick(void)
ktime_t now;
local_irq_disable();
- if (ts->idle_active || (ts->inidle && ts->tick_stopped))
- now = ktime_get();
- if (ts->idle_active)
+ if (ts->inidle) {
+ now = ktime_get();
tick_nohz_stop_idle(cpu, now);
+ }
if (!ts->inidle || !ts->tick_stopped) {
ts->inidle = 0;
@@ -677,10 +675,10 @@ static inline void tick_check_nohz(int cpu)
struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
ktime_t now;
- if (!ts->idle_active && !ts->tick_stopped)
+ if (!ts->inidle && !ts->tick_stopped)
return;
now = ktime_get();
- if (ts->idle_active)
+ if (ts->inidle)
tick_nohz_stop_idle(cpu, now);
if (ts->tick_stopped) {
tick_nohz_update_jiffies(now);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/2] nohz: Drop useless ts->inidle check before rearming the tick
2011-07-21 18:49 [PATCH 1/2] nohz: Drop useless call in tick_nohz_start_idle() Frederic Weisbecker
2011-07-21 18:49 ` [PATCH 2/2] nohz: Drop ts->idle_active Frederic Weisbecker
@ 2011-07-25 21:14 ` Frederic Weisbecker
2011-08-23 16:50 ` [PATCH 1/2] nohz: Drop useless call in tick_nohz_start_idle() Frederic Weisbecker
2011-09-01 12:31 ` Frederic Weisbecker
3 siblings, 0 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2011-07-25 21:14 UTC (permalink / raw)
To: LKML; +Cc: Frederic Weisbecker, Thomas Gleixner, Ingo Molnar, Peter Zijlstra
We only need to check if we have ts->stopped to ensure the tick
was stopped and we want to re-enable it. Checking ts->inidle
there is useless.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
kernel/time/tick-sched.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index c4d7113..5934aee 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -504,16 +504,14 @@ void tick_nohz_restart_sched_tick(void)
if (ts->inidle) {
now = ktime_get();
tick_nohz_stop_idle(cpu, now);
+ ts->inidle = 0;
}
- if (!ts->inidle || !ts->tick_stopped) {
- ts->inidle = 0;
+ if (!ts->tick_stopped) {
local_irq_enable();
return;
}
- ts->inidle = 0;
-
rcu_exit_nohz();
/* Update jiffies first */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] nohz: Drop useless call in tick_nohz_start_idle()
2011-07-21 18:49 [PATCH 1/2] nohz: Drop useless call in tick_nohz_start_idle() Frederic Weisbecker
2011-07-21 18:49 ` [PATCH 2/2] nohz: Drop ts->idle_active Frederic Weisbecker
2011-07-25 21:14 ` [PATCH 3/2] nohz: Drop useless ts->inidle check before rearming the tick Frederic Weisbecker
@ 2011-08-23 16:50 ` Frederic Weisbecker
2011-09-01 12:31 ` Frederic Weisbecker
3 siblings, 0 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2011-08-23 16:50 UTC (permalink / raw)
To: LKML, Ingo Molnar, Thomas Gleixner; +Cc: Peter Zijlstra
Ping? No problem with these three patches?
On Thu, Jul 21, 2011 at 08:49:36PM +0200, Frederic Weisbecker wrote:
> The call to update_ts_time_stats() there is useless. All
> we need is to save the idle entry_time.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
> kernel/time/tick-sched.c | 3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index d5097c4..58e1a96 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -185,9 +185,6 @@ static ktime_t tick_nohz_start_idle(int cpu, struct tick_sched *ts)
> ktime_t now;
>
> now = ktime_get();
> -
> - update_ts_time_stats(cpu, ts, now, NULL);
> -
> ts->idle_entrytime = now;
> ts->idle_active = 1;
> sched_clock_idle_sleep_event();
> --
> 1.7.5.4
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] nohz: Drop useless call in tick_nohz_start_idle()
2011-07-21 18:49 [PATCH 1/2] nohz: Drop useless call in tick_nohz_start_idle() Frederic Weisbecker
` (2 preceding siblings ...)
2011-08-23 16:50 ` [PATCH 1/2] nohz: Drop useless call in tick_nohz_start_idle() Frederic Weisbecker
@ 2011-09-01 12:31 ` Frederic Weisbecker
3 siblings, 0 replies; 5+ messages in thread
From: Frederic Weisbecker @ 2011-09-01 12:31 UTC (permalink / raw)
To: LKML; +Cc: Ingo Molnar, Thomas Gleixner, Peter Zijlstra
Forget these patches. Peterz found that the 2nd one is buggy and
I need to refine the others changelog.
Thnaks.
On Thu, Jul 21, 2011 at 08:49:36PM +0200, Frederic Weisbecker wrote:
> The call to update_ts_time_stats() there is useless. All
> we need is to save the idle entry_time.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
> kernel/time/tick-sched.c | 3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
> index d5097c4..58e1a96 100644
> --- a/kernel/time/tick-sched.c
> +++ b/kernel/time/tick-sched.c
> @@ -185,9 +185,6 @@ static ktime_t tick_nohz_start_idle(int cpu, struct tick_sched *ts)
> ktime_t now;
>
> now = ktime_get();
> -
> - update_ts_time_stats(cpu, ts, now, NULL);
> -
> ts->idle_entrytime = now;
> ts->idle_active = 1;
> sched_clock_idle_sleep_event();
> --
> 1.7.5.4
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-09-01 12:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-21 18:49 [PATCH 1/2] nohz: Drop useless call in tick_nohz_start_idle() Frederic Weisbecker
2011-07-21 18:49 ` [PATCH 2/2] nohz: Drop ts->idle_active Frederic Weisbecker
2011-07-25 21:14 ` [PATCH 3/2] nohz: Drop useless ts->inidle check before rearming the tick Frederic Weisbecker
2011-08-23 16:50 ` [PATCH 1/2] nohz: Drop useless call in tick_nohz_start_idle() Frederic Weisbecker
2011-09-01 12:31 ` Frederic Weisbecker
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.