Re: [PATCH v3 2/3] sched: factor out code to should_we_balance()

2013-08-16 Thread JoonSoo Kim
>> +static int should_we_balance(struct lb_env *env) >> +{ >> + struct sched_group *sg = env->sd->groups; >> + struct cpumask *sg_cpus, *sg_mask; >> + int cpu, balance_cpu = -1; >> + >> + /* >> + * In the newly idle case, we will allow all the cpu's >> + * to do the newly

Re: [PATCH v3 2/3] sched: factor out code to should_we_balance()

2013-08-16 Thread JoonSoo Kim
Hello, Peter. 2013/8/15 Peter Zijlstra : > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -5120,11 +5120,8 @@ static int load_balance(int this_cpu, st > > schedstat_inc(sd, lb_count[idle]); > > - if (!should_we_balance()) { > - *should_balance = 0; > +

Re: [PATCH v3 2/3] sched: factor out code to should_we_balance()

2013-08-16 Thread JoonSoo Kim
Hello, Peter. 2013/8/15 Peter Zijlstra pet...@infradead.org: --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5120,11 +5120,8 @@ static int load_balance(int this_cpu, st schedstat_inc(sd, lb_count[idle]); - if (!should_we_balance(env)) { -

Re: [PATCH v3 2/3] sched: factor out code to should_we_balance()

2013-08-16 Thread JoonSoo Kim
+static int should_we_balance(struct lb_env *env) +{ + struct sched_group *sg = env-sd-groups; + struct cpumask *sg_cpus, *sg_mask; + int cpu, balance_cpu = -1; + + /* + * In the newly idle case, we will allow all the cpu's + * to do the newly idle load balance.

Re: [PATCH v3 2/3] sched: factor out code to should_we_balance()

2013-08-15 Thread Peter Zijlstra
On Tue, Aug 06, 2013 at 05:36:42PM +0900, Joonsoo Kim wrote: > - if (local_group) > - balance_cpu = group_balance_cpu(group); > - > /* Bias balancing toward cpus of our domain */ > - if (local_group) { > - if (idle_cpu(i) &&

Re: [PATCH v3 2/3] sched: factor out code to should_we_balance()

2013-08-15 Thread Peter Zijlstra
On Tue, Aug 06, 2013 at 05:36:42PM +0900, Joonsoo Kim wrote: Another one of these patches I should stare in more detail at.. > static int load_balance(int this_cpu, struct rq *this_rq, > struct sched_domain *sd, enum cpu_idle_type idle, > - int

Re: [PATCH v3 2/3] sched: factor out code to should_we_balance()

2013-08-15 Thread Peter Zijlstra
On Tue, Aug 06, 2013 at 05:36:42PM +0900, Joonsoo Kim wrote: Another one of these patches I should stare in more detail at.. static int load_balance(int this_cpu, struct rq *this_rq, struct sched_domain *sd, enum cpu_idle_type idle, - int *balance)

Re: [PATCH v3 2/3] sched: factor out code to should_we_balance()

2013-08-15 Thread Peter Zijlstra
On Tue, Aug 06, 2013 at 05:36:42PM +0900, Joonsoo Kim wrote: - if (local_group) - balance_cpu = group_balance_cpu(group); - /* Bias balancing toward cpus of our domain */ - if (local_group) { - if (idle_cpu(i) !first_idle_cpu

[PATCH v3 2/3] sched: factor out code to should_we_balance()

2013-08-06 Thread Joonsoo Kim
Now checking whether this cpu is appropriate to balance or not is embedded into update_sg_lb_stats() and this checking has no direct relationship to this function. There is not enough reason to place this checking at update_sg_lb_stats(), except saving one iteration for sched_group_cpus. In this

[PATCH v3 2/3] sched: factor out code to should_we_balance()

2013-08-06 Thread Joonsoo Kim
Now checking whether this cpu is appropriate to balance or not is embedded into update_sg_lb_stats() and this checking has no direct relationship to this function. There is not enough reason to place this checking at update_sg_lb_stats(), except saving one iteration for sched_group_cpus. In this