Re: [PATCH] sched:skip loop non-idle cpus after find an idle cpu while find_idlest_cpu

2014-10-27 Thread Srikar Dronamraju
* Yao Dongdong  [2014-10-27 16:58:05]:

> On 2014/10/27 16:04, Srikar Dronamraju wrote:
> > * Yao Dongdong  [2014-10-27 11:13:17]:
> >
> >> Idle cpu is idler than non-idle cpu, so we needn't loop non-idle cpus 
> >> after find an idle cpu.
> >>
> > While this check looks good,
> > I dont see how we are avoiding a loop?
> >
> > Are you suggesting that we break of the for loop once we set
> > shallowest_idle_cpu?
> >
> Thanks for your review.
> 
> I agree that the submit message is a bit misleading, what this patch do is 
> just avoiding search for least_loaded_cpu
> in non-idle cpus.
> 
> sched:add check of shallowest_idle_cpu before search for least_loaded_cpu
> 
> Idle cpu is idler than non-idle cpu, so we needn't search for 
> least_loaded_cpu
> after we have found an idle cpu.
> 

Looks good for me.

Reviewed-by: Srikar Dronamraju 


-- 
Thanks and Regards
Srikar Dronamraju

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] sched:skip loop non-idle cpus after find an idle cpu while find_idlest_cpu

2014-10-27 Thread Yao Dongdong
On 2014/10/27 16:04, Srikar Dronamraju wrote:
> * Yao Dongdong  [2014-10-27 11:13:17]:
>
>> Idle cpu is idler than non-idle cpu, so we needn't loop non-idle cpus after 
>> find an idle cpu.
>>
> While this check looks good,
> I dont see how we are avoiding a loop?
>
> Are you suggesting that we break of the for loop once we set
> shallowest_idle_cpu?
>
Thanks for your review.

I agree that the submit message is a bit misleading, what this patch do is just 
avoiding search for least_loaded_cpu
in non-idle cpus.

sched:add check of shallowest_idle_cpu before search for least_loaded_cpu

Idle cpu is idler than non-idle cpu, so we needn't search for 
least_loaded_cpu
after we have found an idle cpu.

what about this?

Thanks,
Yao Dongdong

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] sched:skip loop non-idle cpus after find an idle cpu while find_idlest_cpu

2014-10-27 Thread Srikar Dronamraju
* Yao Dongdong  [2014-10-27 11:13:17]:

> Idle cpu is idler than non-idle cpu, so we needn't loop non-idle cpus after 
> find an idle cpu.
> 

While this check looks good,
I dont see how we are avoiding a loop?

Are you suggesting that we break of the for loop once we set
shallowest_idle_cpu?

-- 
Thanks and Regards
Srikar


> Signed-off-by:yaodongd...@huawei.com
> 
> ---
>  kernel/sched/fair.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 0b069bf..2445a23 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -4446,7 +4446,7 @@ find_idlest_cpu(struct sched_group *group, struct 
> task_struct *p, int this_cpu)
> latest_idle_timestamp = rq->idle_stamp;
> shallowest_idle_cpu = i;
> }
> -   } else {
> +   } else if (shallowest_idle_cpu == -1) {
> load = weighted_cpuload(i);
> if (load < min_load || (load == min_load && i == 
> this_cpu)) {
> min_load = load;
> --
> 1.8.0.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Thanks and Regards
Srikar Dronamraju

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] sched:skip loop non-idle cpus after find an idle cpu while find_idlest_cpu

2014-10-27 Thread Srikar Dronamraju
* Yao Dongdong yaodongd...@huawei.com [2014-10-27 11:13:17]:

 Idle cpu is idler than non-idle cpu, so we needn't loop non-idle cpus after 
 find an idle cpu.
 

While this check looks good,
I dont see how we are avoiding a loop?

Are you suggesting that we break of the for loop once we set
shallowest_idle_cpu?

-- 
Thanks and Regards
Srikar


 Signed-off-by:yaodongd...@huawei.com
 
 ---
  kernel/sched/fair.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
 index 0b069bf..2445a23 100644
 --- a/kernel/sched/fair.c
 +++ b/kernel/sched/fair.c
 @@ -4446,7 +4446,7 @@ find_idlest_cpu(struct sched_group *group, struct 
 task_struct *p, int this_cpu)
 latest_idle_timestamp = rq-idle_stamp;
 shallowest_idle_cpu = i;
 }
 -   } else {
 +   } else if (shallowest_idle_cpu == -1) {
 load = weighted_cpuload(i);
 if (load  min_load || (load == min_load  i == 
 this_cpu)) {
 min_load = load;
 --
 1.8.0.1
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/

-- 
Thanks and Regards
Srikar Dronamraju

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] sched:skip loop non-idle cpus after find an idle cpu while find_idlest_cpu

2014-10-27 Thread Yao Dongdong
On 2014/10/27 16:04, Srikar Dronamraju wrote:
 * Yao Dongdong yaodongd...@huawei.com [2014-10-27 11:13:17]:

 Idle cpu is idler than non-idle cpu, so we needn't loop non-idle cpus after 
 find an idle cpu.

 While this check looks good,
 I dont see how we are avoiding a loop?

 Are you suggesting that we break of the for loop once we set
 shallowest_idle_cpu?

Thanks for your review.

I agree that the submit message is a bit misleading, what this patch do is just 
avoiding search for least_loaded_cpu
in non-idle cpus.

sched:add check of shallowest_idle_cpu before search for least_loaded_cpu

Idle cpu is idler than non-idle cpu, so we needn't search for 
least_loaded_cpu
after we have found an idle cpu.

what about this?

Thanks,
Yao Dongdong

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] sched:skip loop non-idle cpus after find an idle cpu while find_idlest_cpu

2014-10-27 Thread Srikar Dronamraju
* Yao Dongdong yaodongd...@huawei.com [2014-10-27 16:58:05]:

 On 2014/10/27 16:04, Srikar Dronamraju wrote:
  * Yao Dongdong yaodongd...@huawei.com [2014-10-27 11:13:17]:
 
  Idle cpu is idler than non-idle cpu, so we needn't loop non-idle cpus 
  after find an idle cpu.
 
  While this check looks good,
  I dont see how we are avoiding a loop?
 
  Are you suggesting that we break of the for loop once we set
  shallowest_idle_cpu?
 
 Thanks for your review.
 
 I agree that the submit message is a bit misleading, what this patch do is 
 just avoiding search for least_loaded_cpu
 in non-idle cpus.
 
 sched:add check of shallowest_idle_cpu before search for least_loaded_cpu
 
 Idle cpu is idler than non-idle cpu, so we needn't search for 
 least_loaded_cpu
 after we have found an idle cpu.
 

Looks good for me.

Reviewed-by: Srikar Dronamraju sri...@linux.vnet.ibm.com


-- 
Thanks and Regards
Srikar Dronamraju

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] sched:skip loop non-idle cpus after find an idle cpu while find_idlest_cpu

2014-10-26 Thread Yao Dongdong
Idle cpu is idler than non-idle cpu, so we needn't loop non-idle cpus after 
find an idle cpu.

Signed-off-by:yaodongd...@huawei.com

---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0b069bf..2445a23 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4446,7 +4446,7 @@ find_idlest_cpu(struct sched_group *group, struct 
task_struct *p, int this_cpu)
latest_idle_timestamp = rq->idle_stamp;
shallowest_idle_cpu = i;
}
-   } else {
+   } else if (shallowest_idle_cpu == -1) {
load = weighted_cpuload(i);
if (load < min_load || (load == min_load && i == 
this_cpu)) {
min_load = load;
--
1.8.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] sched:skip loop non-idle cpus after find an idle cpu while find_idlest_cpu

2014-10-26 Thread Yao Dongdong
Idle cpu is idler than non-idle cpu, so we needn't loop non-idle cpus after 
find an idle cpu.

Signed-off-by:yaodongd...@huawei.com

---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0b069bf..2445a23 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4446,7 +4446,7 @@ find_idlest_cpu(struct sched_group *group, struct 
task_struct *p, int this_cpu)
latest_idle_timestamp = rq-idle_stamp;
shallowest_idle_cpu = i;
}
-   } else {
+   } else if (shallowest_idle_cpu == -1) {
load = weighted_cpuload(i);
if (load  min_load || (load == min_load  i == 
this_cpu)) {
min_load = load;
--
1.8.0.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/