Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Morten Rasmussen
On Wed, Jun 04, 2014 at 02:09:18PM +0100, Morten Rasmussen wrote: > On Wed, Jun 04, 2014 at 12:52:46PM +0100, Vincent Guittot wrote: > > On 4 June 2014 13:23, Morten Rasmussen wrote: > > > I get: > > > > > > A: 15/40 ms = 37.5% > > > B: 20/40 ms = 50% > > > > > > Schedule: > > > > > >| 5 ms |

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Morten Rasmussen
On Wed, Jun 04, 2014 at 12:52:46PM +0100, Vincent Guittot wrote: > On 4 June 2014 13:23, Morten Rasmussen wrote: > > I get: > > > > A: 15/40 ms = 37.5% > > B: 20/40 ms = 50% > > > > Schedule: > > > >| 5 ms | 5 ms | 5 ms | 5 ms | 5 ms | 5 ms | 5 ms | 5 ms | 5 ms | > > A: run rq run -

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Vincent Guittot
On 4 June 2014 13:23, Morten Rasmussen wrote: > On Wed, Jun 04, 2014 at 12:07:29PM +0100, Vincent Guittot wrote: >> On 4 June 2014 12:36, Morten Rasmussen wrote: >> > On Wed, Jun 04, 2014 at 11:17:24AM +0100, Peter Zijlstra wrote: >> >> On Wed, Jun 04, 2014 at 11:32:10AM +0200, Vincent Guittot wr

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Morten Rasmussen
On Wed, Jun 04, 2014 at 12:07:29PM +0100, Vincent Guittot wrote: > On 4 June 2014 12:36, Morten Rasmussen wrote: > > On Wed, Jun 04, 2014 at 11:17:24AM +0100, Peter Zijlstra wrote: > >> On Wed, Jun 04, 2014 at 11:32:10AM +0200, Vincent Guittot wrote: > >> > On 4 June 2014 10:08, Peter Zijlstra wr

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Vincent Guittot
On 4 June 2014 12:36, Morten Rasmussen wrote: > On Wed, Jun 04, 2014 at 11:17:24AM +0100, Peter Zijlstra wrote: >> On Wed, Jun 04, 2014 at 11:32:10AM +0200, Vincent Guittot wrote: >> > On 4 June 2014 10:08, Peter Zijlstra wrote: >> > > On Wed, Jun 04, 2014 at 09:47:26AM +0200, Vincent Guittot wro

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Peter Zijlstra
On Wed, Jun 04, 2014 at 11:36:19AM +0100, Morten Rasmussen wrote: > On Wed, Jun 04, 2014 at 11:17:24AM +0100, Peter Zijlstra wrote: > > Let me explain the 75%, take any one of the above scenarios. Lets call > > the two tasks A and B, and let for a moment assume A always wins and > > runs first, and

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Morten Rasmussen
On Wed, Jun 04, 2014 at 11:17:24AM +0100, Peter Zijlstra wrote: > On Wed, Jun 04, 2014 at 11:32:10AM +0200, Vincent Guittot wrote: > > On 4 June 2014 10:08, Peter Zijlstra wrote: > > > On Wed, Jun 04, 2014 at 09:47:26AM +0200, Vincent Guittot wrote: > > >> On 3 June 2014 17:50, Peter Zijlstra wro

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Morten Rasmussen
On Wed, Jun 04, 2014 at 10:35:15AM +0100, Vincent Guittot wrote: > On 4 June 2014 11:23, Peter Zijlstra wrote: > > On Wed, Jun 04, 2014 at 09:55:42AM +0100, Morten Rasmussen wrote: > >> Both running_avg and runnable_avg are affected by other tasks on the > >> same cpus, but in different ways. They

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Peter Zijlstra
On Wed, Jun 04, 2014 at 11:32:10AM +0200, Vincent Guittot wrote: > On 4 June 2014 10:08, Peter Zijlstra wrote: > > On Wed, Jun 04, 2014 at 09:47:26AM +0200, Vincent Guittot wrote: > >> On 3 June 2014 17:50, Peter Zijlstra wrote: > >> > On Wed, May 28, 2014 at 04:47:03PM +0100, Morten Rasmussen wr

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Morten Rasmussen
On Wed, Jun 04, 2014 at 10:32:10AM +0100, Vincent Guittot wrote: > On 4 June 2014 10:08, Peter Zijlstra wrote: > > On Wed, Jun 04, 2014 at 09:47:26AM +0200, Vincent Guittot wrote: > >> On 3 June 2014 17:50, Peter Zijlstra wrote: > >> > On Wed, May 28, 2014 at 04:47:03PM +0100, Morten Rasmussen wr

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Morten Rasmussen
On Wed, Jun 04, 2014 at 10:23:13AM +0100, Peter Zijlstra wrote: > > f you had five tasks on one cpu that each have a 25% requirement you can > > get individual task runnable_avgs of up to 100% (cpu unweighted > > runnable_load_avg can get up 500%, I think), but the task running_avgs > > would be 20

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Vincent Guittot
On 4 June 2014 11:23, Peter Zijlstra wrote: > On Wed, Jun 04, 2014 at 09:55:42AM +0100, Morten Rasmussen wrote: >> Both running_avg and runnable_avg are affected by other tasks on the >> same cpus, but in different ways. They are equal if you only have one >> task on a cpu. If you have more, runni

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Vincent Guittot
On 4 June 2014 10:08, Peter Zijlstra wrote: > On Wed, Jun 04, 2014 at 09:47:26AM +0200, Vincent Guittot wrote: >> On 3 June 2014 17:50, Peter Zijlstra wrote: >> > On Wed, May 28, 2014 at 04:47:03PM +0100, Morten Rasmussen wrote: >> >> Since we may do periodic load-balance every 10 ms or so, we wi

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Peter Zijlstra
On Wed, Jun 04, 2014 at 09:55:42AM +0100, Morten Rasmussen wrote: > Both running_avg and runnable_avg are affected by other tasks on the > same cpus, but in different ways. They are equal if you only have one > task on a cpu. If you have more, running_avg will give you the true > requirement of the

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Morten Rasmussen
On Wed, Jun 04, 2014 at 09:08:09AM +0100, Peter Zijlstra wrote: > On Wed, Jun 04, 2014 at 09:47:26AM +0200, Vincent Guittot wrote: > > On 3 June 2014 17:50, Peter Zijlstra wrote: > > > On Wed, May 28, 2014 at 04:47:03PM +0100, Morten Rasmussen wrote: > > >> Since we may do periodic load-balance ev

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Peter Zijlstra
On Wed, Jun 04, 2014 at 09:47:26AM +0200, Vincent Guittot wrote: > On 3 June 2014 17:50, Peter Zijlstra wrote: > > On Wed, May 28, 2014 at 04:47:03PM +0100, Morten Rasmussen wrote: > >> Since we may do periodic load-balance every 10 ms or so, we will perform > >> a number of load-balances where ru

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Vincent Guittot
On 3 June 2014 17:50, Peter Zijlstra wrote: > On Wed, May 28, 2014 at 04:47:03PM +0100, Morten Rasmussen wrote: >> Since we may do periodic load-balance every 10 ms or so, we will perform >> a number of load-balances where runnable_avg_sum will mostly be >> reflecting the state of the world before

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-04 Thread Yuyang Du
> > The basic problem is that worst case: sum starting from 0 and period > > already at LOAD_AVG_MAX = 47742, it takes LOAD_AVG_MAX_N = 345 periods > > (ms) for sum to reach 47742. In other words, the cpu might have been > > fully utilized for 345 ms before it is considered fully utilized. > > Peri

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-03 Thread Morten Rasmussen
On Tue, Jun 03, 2014 at 04:59:39PM +0100, Peter Zijlstra wrote: > On Tue, Jun 03, 2014 at 01:03:54PM +0100, Morten Rasmussen wrote: > > An unweighted version of cfs.runnable_load_avg gives you a metric that > > captures cpu utilization to some extend, but not the number of tasks. > > And it reflect

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-03 Thread Peter Zijlstra
On Tue, Jun 03, 2014 at 06:16:28PM +0100, Morten Rasmussen wrote: > > So the per-task-load-tracking stuff already does that. It updates the > > per-cpu load metrics on migration. See {de,en}queue_entity_load_avg(). > > I think there is some confusion here. There are two per-cpu load metrics > that

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-03 Thread Peter Zijlstra
On Tue, Jun 03, 2014 at 06:16:28PM +0100, Morten Rasmussen wrote: > > I'm not too worried about the tipping point, per task runnable figures > > of an overloaded cpu are higher, so migration between an overloaded cpu > > and an underloaded cpu are going to be tricky no matter what we do. > > Yes,

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-03 Thread Morten Rasmussen
On Tue, Jun 03, 2014 at 04:50:07PM +0100, Peter Zijlstra wrote: > On Wed, May 28, 2014 at 04:47:03PM +0100, Morten Rasmussen wrote: > > Since we may do periodic load-balance every 10 ms or so, we will perform > > a number of load-balances where runnable_avg_sum will mostly be > > reflecting the sta

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-03 Thread Morten Rasmussen
On Tue, Jun 03, 2014 at 04:40:58PM +0100, Peter Zijlstra wrote: > On Wed, May 28, 2014 at 01:10:01PM +0100, Morten Rasmussen wrote: > > The rq runnable_avg_{sum, period} give a very long term view of the cpu > > utilization (I will use the term utilization instead of activity as I > > think that is

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-03 Thread Peter Zijlstra
On Tue, Jun 03, 2014 at 01:03:54PM +0100, Morten Rasmussen wrote: > On Wed, May 28, 2014 at 05:39:10PM +0100, Vincent Guittot wrote: > > On 28 May 2014 17:47, Morten Rasmussen wrote: > > > On Wed, May 28, 2014 at 02:15:03PM +0100, Vincent Guittot wrote: > > >> On 28 May 2014 14:10, Morten Rasmusse

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-03 Thread Peter Zijlstra
On Wed, May 28, 2014 at 04:47:03PM +0100, Morten Rasmussen wrote: > Since we may do periodic load-balance every 10 ms or so, we will perform > a number of load-balances where runnable_avg_sum will mostly be > reflecting the state of the world before a change (new task queued or > moved a task to a

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-03 Thread Peter Zijlstra
On Wed, May 28, 2014 at 01:10:01PM +0100, Morten Rasmussen wrote: > The rq runnable_avg_{sum, period} give a very long term view of the cpu > utilization (I will use the term utilization instead of activity as I > think that is what we are talking about here). IMHO, it is too slow to > be used as b

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-03 Thread Morten Rasmussen
On Wed, May 28, 2014 at 05:39:10PM +0100, Vincent Guittot wrote: > On 28 May 2014 17:47, Morten Rasmussen wrote: > > On Wed, May 28, 2014 at 02:15:03PM +0100, Vincent Guittot wrote: > >> On 28 May 2014 14:10, Morten Rasmussen wrote: > >> > On Fri, May 23, 2014 at 04:53:02PM +0100, Vincent Guittot

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-02 Thread Vincent Guittot
On 1 June 2014 13:33, Dietmar Eggemann wrote: > On 30/05/14 20:20, Vincent Guittot wrote: >> >> On 30 May 2014 11:50, Dietmar Eggemann wrote: >>> >>> On 23/05/14 16:53, Vincent Guittot wrote: Monitor the activity level of each group of each sched_domain level. The activity is the a

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-06-01 Thread Dietmar Eggemann
On 30/05/14 20:20, Vincent Guittot wrote: On 30 May 2014 11:50, Dietmar Eggemann wrote: On 23/05/14 16:53, Vincent Guittot wrote: Monitor the activity level of each group of each sched_domain level. The activity is the amount of cpu_power that is currently used on a CPU or group of CPUs. We us

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-05-30 Thread Vincent Guittot
On 30 May 2014 11:50, Dietmar Eggemann wrote: > On 23/05/14 16:53, Vincent Guittot wrote: >> Monitor the activity level of each group of each sched_domain level. The >> activity is the amount of cpu_power that is currently used on a CPU or group >> of CPUs. We use the runnable_avg_sum and _period

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-05-30 Thread Dietmar Eggemann
On 23/05/14 16:53, Vincent Guittot wrote: > Monitor the activity level of each group of each sched_domain level. The > activity is the amount of cpu_power that is currently used on a CPU or group > of CPUs. We use the runnable_avg_sum and _period to evaluate this activity > level. In the special us

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-05-28 Thread Vincent Guittot
On 28 May 2014 17:47, Morten Rasmussen wrote: > On Wed, May 28, 2014 at 02:15:03PM +0100, Vincent Guittot wrote: >> On 28 May 2014 14:10, Morten Rasmussen wrote: >> > On Fri, May 23, 2014 at 04:53:02PM +0100, Vincent Guittot wrote: [snip] > >> This value is linked to the CPU on >> which it has

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-05-28 Thread Morten Rasmussen
On Wed, May 28, 2014 at 02:15:03PM +0100, Vincent Guittot wrote: > On 28 May 2014 14:10, Morten Rasmussen wrote: > > On Fri, May 23, 2014 at 04:53:02PM +0100, Vincent Guittot wrote: > >> Monitor the activity level of each group of each sched_domain level. The > >> activity is the amount of cpu_pow

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-05-28 Thread Peter Zijlstra
On Wed, May 28, 2014 at 01:10:01PM +0100, Morten Rasmussen wrote: > The basic problem is that worst case: sum starting from 0 and period > already at LOAD_AVG_MAX = 47742, it takes LOAD_AVG_MAX_N = 345 periods > (ms) for sum to reach 47742. But it takes only 4 periods (4*32ms) to get ~94% of the

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-05-28 Thread Vincent Guittot
On 28 May 2014 14:10, Morten Rasmussen wrote: > On Fri, May 23, 2014 at 04:53:02PM +0100, Vincent Guittot wrote: >> Monitor the activity level of each group of each sched_domain level. The >> activity is the amount of cpu_power that is currently used on a CPU or group >> of CPUs. We use the runnab

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-05-28 Thread Morten Rasmussen
On Fri, May 23, 2014 at 04:53:02PM +0100, Vincent Guittot wrote: > Monitor the activity level of each group of each sched_domain level. The > activity is the amount of cpu_power that is currently used on a CPU or group > of CPUs. We use the runnable_avg_sum and _period to evaluate this activity > l

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-05-28 Thread Vincent Guittot
On 27 May 2014 19:32, Peter Zijlstra wrote: > On Fri, May 23, 2014 at 05:53:02PM +0200, Vincent Guittot wrote: >> Monitor the activity level of each group of each sched_domain level. The >> activity is the amount of cpu_power that is currently used on a CPU or group >> of CPUs. We use the runnable

Re: [PATCH v2 08/11] sched: get CPU's activity statistic

2014-05-27 Thread Peter Zijlstra
On Fri, May 23, 2014 at 05:53:02PM +0200, Vincent Guittot wrote: > Monitor the activity level of each group of each sched_domain level. The > activity is the amount of cpu_power that is currently used on a CPU or group > of CPUs. We use the runnable_avg_sum and _period to evaluate this activity > l

[PATCH v2 08/11] sched: get CPU's activity statistic

2014-05-23 Thread Vincent Guittot
Monitor the activity level of each group of each sched_domain level. The activity is the amount of cpu_power that is currently used on a CPU or group of CPUs. We use the runnable_avg_sum and _period to evaluate this activity level. In the special use case where the CPU is fully loaded by more than