Re: [PATCH] sched/fair: Update rq clock before updating nohz cpu load

2016-05-03 Thread Wanpeng Li
2016-05-04 3:46 GMT+08:00 Matt Fleming :
> If we're accessing rq_clock() (e.g. in sched_avg_update()) we should
> update the rq clock before calling cpu_load_update(), otherwise any
> time calculations will be stale.
>
> All other paths currently call update_rq_clock().
>
> Cc: Peter Zijlstra 
> Cc: Ingo Molnar 
> Cc: Mike Galbraith 
> Cc: Mel Gorman 
> Cc: Thomas Gleixner 
> Cc: Frederic Weisbecker 
> Cc: Rik van Riel 
> Signed-off-by: Matt Fleming 

Reviewed-by: Wanpeng Li 

> ---
>  kernel/sched/fair.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index b8a33abce650..aa9ba82f0d7c 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4723,6 +4723,7 @@ void cpu_load_update_nohz_stop(void)
>
> load = weighted_cpuload(cpu_of(this_rq));
> raw_spin_lock(_rq->lock);
> +   update_rq_clock(this_rq);
> cpu_load_update_nohz(this_rq, curr_jiffies, load);
> raw_spin_unlock(_rq->lock);
>  }
> --
> 2.7.3
>



-- 
Regards,
Wanpeng Li


Re: [PATCH] sched/fair: Update rq clock before updating nohz cpu load

2016-05-03 Thread Wanpeng Li
2016-05-04 3:46 GMT+08:00 Matt Fleming :
> If we're accessing rq_clock() (e.g. in sched_avg_update()) we should
> update the rq clock before calling cpu_load_update(), otherwise any
> time calculations will be stale.
>
> All other paths currently call update_rq_clock().
>
> Cc: Peter Zijlstra 
> Cc: Ingo Molnar 
> Cc: Mike Galbraith 
> Cc: Mel Gorman 
> Cc: Thomas Gleixner 
> Cc: Frederic Weisbecker 
> Cc: Rik van Riel 
> Signed-off-by: Matt Fleming 

Reviewed-by: Wanpeng Li 

> ---
>  kernel/sched/fair.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index b8a33abce650..aa9ba82f0d7c 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4723,6 +4723,7 @@ void cpu_load_update_nohz_stop(void)
>
> load = weighted_cpuload(cpu_of(this_rq));
> raw_spin_lock(_rq->lock);
> +   update_rq_clock(this_rq);
> cpu_load_update_nohz(this_rq, curr_jiffies, load);
> raw_spin_unlock(_rq->lock);
>  }
> --
> 2.7.3
>



-- 
Regards,
Wanpeng Li


[PATCH] sched/fair: Update rq clock before updating nohz cpu load

2016-05-03 Thread Matt Fleming
If we're accessing rq_clock() (e.g. in sched_avg_update()) we should
update the rq clock before calling cpu_load_update(), otherwise any
time calculations will be stale.

All other paths currently call update_rq_clock().

Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Mike Galbraith 
Cc: Mel Gorman 
Cc: Thomas Gleixner 
Cc: Frederic Weisbecker 
Cc: Rik van Riel 
Signed-off-by: Matt Fleming 
---
 kernel/sched/fair.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b8a33abce650..aa9ba82f0d7c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4723,6 +4723,7 @@ void cpu_load_update_nohz_stop(void)
 
load = weighted_cpuload(cpu_of(this_rq));
raw_spin_lock(_rq->lock);
+   update_rq_clock(this_rq);
cpu_load_update_nohz(this_rq, curr_jiffies, load);
raw_spin_unlock(_rq->lock);
 }
-- 
2.7.3



[PATCH] sched/fair: Update rq clock before updating nohz cpu load

2016-05-03 Thread Matt Fleming
If we're accessing rq_clock() (e.g. in sched_avg_update()) we should
update the rq clock before calling cpu_load_update(), otherwise any
time calculations will be stale.

All other paths currently call update_rq_clock().

Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Mike Galbraith 
Cc: Mel Gorman 
Cc: Thomas Gleixner 
Cc: Frederic Weisbecker 
Cc: Rik van Riel 
Signed-off-by: Matt Fleming 
---
 kernel/sched/fair.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b8a33abce650..aa9ba82f0d7c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4723,6 +4723,7 @@ void cpu_load_update_nohz_stop(void)
 
load = weighted_cpuload(cpu_of(this_rq));
raw_spin_lock(_rq->lock);
+   update_rq_clock(this_rq);
cpu_load_update_nohz(this_rq, curr_jiffies, load);
raw_spin_unlock(_rq->lock);
 }
-- 
2.7.3