Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-11-24 Thread Vincent Guittot
On 23 November 2014 at 02:03, Wanpeng Li wrote: > Hi Vincent, > On 10/9/14, 10:18 PM, Vincent Guittot wrote: >> >> On 9 October 2014 14:16, Peter Zijlstra wrote: >>> >>> On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: +static inline bool +group_has_capacity(struct

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-11-24 Thread Vincent Guittot
On 23 November 2014 at 02:03, Wanpeng Li kernel...@gmail.com wrote: Hi Vincent, On 10/9/14, 10:18 PM, Vincent Guittot wrote: On 9 October 2014 14:16, Peter Zijlstra pet...@infradead.org wrote: On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: +static inline bool

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-11-22 Thread Wanpeng Li
Hi Vincent, On 10/9/14, 10:18 PM, Vincent Guittot wrote: On 9 October 2014 14:16, Peter Zijlstra wrote: On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: +static inline bool +group_has_capacity(struct lb_env *env, struct sg_lb_stats *sgs) { + if ((sgs->group_capacity *

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-11-22 Thread Wanpeng Li
Hi Vincent, On 10/9/14, 10:18 PM, Vincent Guittot wrote: On 9 October 2014 14:16, Peter Zijlstra pet...@infradead.org wrote: On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: +static inline bool +group_has_capacity(struct lb_env *env, struct sg_lb_stats *sgs) { + if

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-21 Thread Vincent Guittot
On 9 October 2014 16:58, Peter Zijlstra wrote: > On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: >> @@ -6214,17 +6178,21 @@ static inline void update_sd_lb_stats(struct lb_env >> *env, struct sd_lb_stats *sd >> >> /* >>* In case the child domain

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-21 Thread Vincent Guittot
On 9 October 2014 16:58, Peter Zijlstra pet...@infradead.org wrote: On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: @@ -6214,17 +6178,21 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd /* * In case the child

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-10 Thread Vincent Guittot
On 10 October 2014 09:17, Vincent Guittot wrote: > > yes i think it latter because it give a more stable view of the s/latter/matter/ > "overload state" and "have free capacity state" of the CPU. > One additional point is that the imbalance_pct will ensure that a > cpu/group will not been seen

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-10 Thread Vincent Guittot
On 9 October 2014 17:18, Peter Zijlstra wrote: > On Thu, Oct 09, 2014 at 04:18:02PM +0200, Vincent Guittot wrote: >> On 9 October 2014 14:16, Peter Zijlstra wrote: >> > On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: >> >> +static inline bool >> >> +group_has_capacity(struct

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-10 Thread Vincent Guittot
On 9 October 2014 17:18, Peter Zijlstra pet...@infradead.org wrote: On Thu, Oct 09, 2014 at 04:18:02PM +0200, Vincent Guittot wrote: On 9 October 2014 14:16, Peter Zijlstra pet...@infradead.org wrote: On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: +static inline bool

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-10 Thread Vincent Guittot
On 10 October 2014 09:17, Vincent Guittot vincent.guit...@linaro.org wrote: yes i think it latter because it give a more stable view of the s/latter/matter/ overload state and have free capacity state of the CPU. One additional point is that the imbalance_pct will ensure that a cpu/group

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Peter Zijlstra
On Thu, Oct 09, 2014 at 04:18:02PM +0200, Vincent Guittot wrote: > On 9 October 2014 14:16, Peter Zijlstra wrote: > > On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: > >> +static inline bool > >> +group_has_capacity(struct lb_env *env, struct sg_lb_stats *sgs) > >> { > >> +

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Peter Zijlstra
On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: > @@ -6214,17 +6178,21 @@ static inline void update_sd_lb_stats(struct lb_env > *env, struct sd_lb_stats *sd > > /* >* In case the child domain prefers tasks go to siblings > - * first,

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Vincent Guittot
On 9 October 2014 16:16, Peter Zijlstra wrote: > On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: >> @@ -6214,17 +6178,21 @@ static inline void update_sd_lb_stats(struct lb_env >> *env, struct sd_lb_stats *sd >> >> /* >>* In case the child domain

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Vincent Guittot
On 9 October 2014 14:16, Peter Zijlstra wrote: > On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: >> +static inline bool >> +group_has_capacity(struct lb_env *env, struct sg_lb_stats *sgs) >> { >> + if ((sgs->group_capacity * 100) > >> + (sgs->group_usage

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Peter Zijlstra
On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: > @@ -6214,17 +6178,21 @@ static inline void update_sd_lb_stats(struct lb_env > *env, struct sd_lb_stats *sd > > /* >* In case the child domain prefers tasks go to siblings > + * first,

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Peter Zijlstra
On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: > +static inline bool > +group_has_capacity(struct lb_env *env, struct sg_lb_stats *sgs) > { > + if ((sgs->group_capacity * 100) > > + (sgs->group_usage * env->sd->imbalance_pct)) > + return true;

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Peter Zijlstra
On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: +static inline bool +group_has_capacity(struct lb_env *env, struct sg_lb_stats *sgs) { + if ((sgs-group_capacity * 100) + (sgs-group_usage * env-sd-imbalance_pct)) + return true; Why the

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Peter Zijlstra
On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: @@ -6214,17 +6178,21 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd /* * In case the child domain prefers tasks go to siblings + * first, lower

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Vincent Guittot
On 9 October 2014 14:16, Peter Zijlstra pet...@infradead.org wrote: On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: +static inline bool +group_has_capacity(struct lb_env *env, struct sg_lb_stats *sgs) { + if ((sgs-group_capacity * 100) +

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Vincent Guittot
On 9 October 2014 16:16, Peter Zijlstra pet...@infradead.org wrote: On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: @@ -6214,17 +6178,21 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd /* * In case the child

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Peter Zijlstra
On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: @@ -6214,17 +6178,21 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd /* * In case the child domain prefers tasks go to siblings - * first, lower

Re: [PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-09 Thread Peter Zijlstra
On Thu, Oct 09, 2014 at 04:18:02PM +0200, Vincent Guittot wrote: On 9 October 2014 14:16, Peter Zijlstra pet...@infradead.org wrote: On Tue, Oct 07, 2014 at 02:13:36PM +0200, Vincent Guittot wrote: +static inline bool +group_has_capacity(struct lb_env *env, struct sg_lb_stats *sgs) { +

[PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-07 Thread Vincent Guittot
The scheduler tries to compute how many tasks a group of CPUs can handle by assuming that a task's load is SCHED_LOAD_SCALE and a CPU's capacity is SCHED_CAPACITY_SCALE but the capacity_factor is hardly working for SMT system, it sometimes works for big cores but fails to do the right thing for

[PATCH v7 6/7] sched: replace capacity_factor by usage

2014-10-07 Thread Vincent Guittot
The scheduler tries to compute how many tasks a group of CPUs can handle by assuming that a task's load is SCHED_LOAD_SCALE and a CPU's capacity is SCHED_CAPACITY_SCALE but the capacity_factor is hardly working for SMT system, it sometimes works for big cores but fails to do the right thing for