Re: [PATCH v3 04/22] sched: don't need go to smaller sched domain

2013-01-10 Thread Preeti U Murthy
On 01/05/2013 02:07 PM, Alex Shi wrote:
> If parent sched domain has no task allowed cpu find. neither find in
> it's child. So, go out to save useless checking.
> 
> Signed-off-by: Alex Shi 
> ---
>  kernel/sched/fair.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 3c7b09a..ecfbf8e 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3378,10 +3378,8 @@ select_task_rq_fair(struct task_struct *p, int 
> sd_flag, int wake_flags)
>   load_idx = sd->wake_idx;
> 
>   group = find_idlest_group(sd, p, cpu, load_idx);
> - if (!group) {
> - sd = sd->child;
> - continue;
> - }
> + if (!group)
> + goto unlock;
> 
>   new_cpu = find_idlest_cpu(group, p, cpu);
> 
Reviewed-by:Preeti U Murthy

--
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 v3 04/22] sched: don't need go to smaller sched domain

2013-01-10 Thread Preeti U Murthy
On 01/05/2013 02:07 PM, Alex Shi wrote:
 If parent sched domain has no task allowed cpu find. neither find in
 it's child. So, go out to save useless checking.
 
 Signed-off-by: Alex Shi alex@intel.com
 ---
  kernel/sched/fair.c | 6 ++
  1 file changed, 2 insertions(+), 4 deletions(-)
 
 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
 index 3c7b09a..ecfbf8e 100644
 --- a/kernel/sched/fair.c
 +++ b/kernel/sched/fair.c
 @@ -3378,10 +3378,8 @@ select_task_rq_fair(struct task_struct *p, int 
 sd_flag, int wake_flags)
   load_idx = sd-wake_idx;
 
   group = find_idlest_group(sd, p, cpu, load_idx);
 - if (!group) {
 - sd = sd-child;
 - continue;
 - }
 + if (!group)
 + goto unlock;
 
   new_cpu = find_idlest_cpu(group, p, cpu);
 
Reviewed-by:Preeti U Murthy

--
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 v3 04/22] sched: don't need go to smaller sched domain

2013-01-09 Thread Mike Galbraith
On Wed, 2013-01-09 at 17:38 +, Morten Rasmussen wrote: 
> On Sat, Jan 05, 2013 at 08:37:33AM +, Alex Shi wrote:
> > If parent sched domain has no task allowed cpu find. neither find in
> > it's child. So, go out to save useless checking.
> > 
> > Signed-off-by: Alex Shi 
> > ---
> >  kernel/sched/fair.c | 6 ++
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> > index 3c7b09a..ecfbf8e 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -3378,10 +3378,8 @@ select_task_rq_fair(struct task_struct *p, int 
> > sd_flag, int wake_flags)
> > load_idx = sd->wake_idx;
> >  
> > group = find_idlest_group(sd, p, cpu, load_idx);
> 
> The previous patch changed the behavior of find_idlest_group() to
> returning the local group if it is suitable. This effectively means that
> you remove the recursive search for a suitable idle sched group. You
> could as well merge find_idlest_group() and find_idlest_cpu() to avoid
> iterating through the cpus of the same sched group twice.

find_idlest_* could stop when seeing 0 too, can't get much more idle.

-Mike

--
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 v3 04/22] sched: don't need go to smaller sched domain

2013-01-09 Thread Morten Rasmussen
On Sat, Jan 05, 2013 at 08:37:33AM +, Alex Shi wrote:
> If parent sched domain has no task allowed cpu find. neither find in
> it's child. So, go out to save useless checking.
> 
> Signed-off-by: Alex Shi 
> ---
>  kernel/sched/fair.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 3c7b09a..ecfbf8e 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -3378,10 +3378,8 @@ select_task_rq_fair(struct task_struct *p, int 
> sd_flag, int wake_flags)
>   load_idx = sd->wake_idx;
>  
>   group = find_idlest_group(sd, p, cpu, load_idx);

The previous patch changed the behavior of find_idlest_group() to
returning the local group if it is suitable. This effectively means that
you remove the recursive search for a suitable idle sched group. You
could as well merge find_idlest_group() and find_idlest_cpu() to avoid
iterating through the cpus of the same sched group twice.

Morten

> - if (!group) {
> - sd = sd->child;
> - continue;
> - }
> + if (!group)
> + goto unlock;
>  
>   new_cpu = find_idlest_cpu(group, p, cpu);
>  
> -- 
> 1.7.12
> 
> --
> 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/
> 

--
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 v3 04/22] sched: don't need go to smaller sched domain

2013-01-09 Thread Morten Rasmussen
On Sat, Jan 05, 2013 at 08:37:33AM +, Alex Shi wrote:
 If parent sched domain has no task allowed cpu find. neither find in
 it's child. So, go out to save useless checking.
 
 Signed-off-by: Alex Shi alex@intel.com
 ---
  kernel/sched/fair.c | 6 ++
  1 file changed, 2 insertions(+), 4 deletions(-)
 
 diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
 index 3c7b09a..ecfbf8e 100644
 --- a/kernel/sched/fair.c
 +++ b/kernel/sched/fair.c
 @@ -3378,10 +3378,8 @@ select_task_rq_fair(struct task_struct *p, int 
 sd_flag, int wake_flags)
   load_idx = sd-wake_idx;
  
   group = find_idlest_group(sd, p, cpu, load_idx);

The previous patch changed the behavior of find_idlest_group() to
returning the local group if it is suitable. This effectively means that
you remove the recursive search for a suitable idle sched group. You
could as well merge find_idlest_group() and find_idlest_cpu() to avoid
iterating through the cpus of the same sched group twice.

Morten

 - if (!group) {
 - sd = sd-child;
 - continue;
 - }
 + if (!group)
 + goto unlock;
  
   new_cpu = find_idlest_cpu(group, p, cpu);
  
 -- 
 1.7.12
 
 --
 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/
 

--
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 v3 04/22] sched: don't need go to smaller sched domain

2013-01-09 Thread Mike Galbraith
On Wed, 2013-01-09 at 17:38 +, Morten Rasmussen wrote: 
 On Sat, Jan 05, 2013 at 08:37:33AM +, Alex Shi wrote:
  If parent sched domain has no task allowed cpu find. neither find in
  it's child. So, go out to save useless checking.
  
  Signed-off-by: Alex Shi alex@intel.com
  ---
   kernel/sched/fair.c | 6 ++
   1 file changed, 2 insertions(+), 4 deletions(-)
  
  diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
  index 3c7b09a..ecfbf8e 100644
  --- a/kernel/sched/fair.c
  +++ b/kernel/sched/fair.c
  @@ -3378,10 +3378,8 @@ select_task_rq_fair(struct task_struct *p, int 
  sd_flag, int wake_flags)
  load_idx = sd-wake_idx;
   
  group = find_idlest_group(sd, p, cpu, load_idx);
 
 The previous patch changed the behavior of find_idlest_group() to
 returning the local group if it is suitable. This effectively means that
 you remove the recursive search for a suitable idle sched group. You
 could as well merge find_idlest_group() and find_idlest_cpu() to avoid
 iterating through the cpus of the same sched group twice.

find_idlest_* could stop when seeing 0 too, can't get much more idle.

-Mike

--
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 v3 04/22] sched: don't need go to smaller sched domain

2013-01-05 Thread Alex Shi
If parent sched domain has no task allowed cpu find. neither find in
it's child. So, go out to save useless checking.

Signed-off-by: Alex Shi 
---
 kernel/sched/fair.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3c7b09a..ecfbf8e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3378,10 +3378,8 @@ select_task_rq_fair(struct task_struct *p, int sd_flag, 
int wake_flags)
load_idx = sd->wake_idx;
 
group = find_idlest_group(sd, p, cpu, load_idx);
-   if (!group) {
-   sd = sd->child;
-   continue;
-   }
+   if (!group)
+   goto unlock;
 
new_cpu = find_idlest_cpu(group, p, cpu);
 
-- 
1.7.12

--
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 v3 04/22] sched: don't need go to smaller sched domain

2013-01-05 Thread Alex Shi
If parent sched domain has no task allowed cpu find. neither find in
it's child. So, go out to save useless checking.

Signed-off-by: Alex Shi alex@intel.com
---
 kernel/sched/fair.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3c7b09a..ecfbf8e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3378,10 +3378,8 @@ select_task_rq_fair(struct task_struct *p, int sd_flag, 
int wake_flags)
load_idx = sd-wake_idx;
 
group = find_idlest_group(sd, p, cpu, load_idx);
-   if (!group) {
-   sd = sd-child;
-   continue;
-   }
+   if (!group)
+   goto unlock;
 
new_cpu = find_idlest_cpu(group, p, cpu);
 
-- 
1.7.12

--
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/