linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V1 RESEND]: sched/fair: Revise comment about lb decision matrix
@ 2022-04-15  2:22 Tao Zhou
  2022-04-15  8:32 ` Vincent Guittot
  0 siblings, 1 reply; 5+ messages in thread
From: Tao Zhou @ 2022-04-15  2:22 UTC (permalink / raw)
  To: LKML, Tao Zhou
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira

If busiest group type is group_misfit_task, the local
group type must be group_has_spare according to below
code in update_sd_pick_busiest():

if (sgs->group_type == group_misfit_task &&
    (!capacity_greater(capacity_of(env->dst_cpu), sg->sgc->max_capacity) ||
     sds->local_stat.group_type != group_has_spare))
         return false;

group type imbalanced and overloaded and fully_busy are filtered in here.
misfit and asym are filtered before in update_sg_lb_stats().
So, change the decision matrix to:

busiest \ local has_spare fully_busy misfit asym imbalanced overloaded
has_spare        nr_idle   balanced   N/A    N/A  balanced   balanced
fully_busy       nr_idle   nr_idle    N/A    N/A  balanced   balanced
misfit_task      force     N/A        N/A    N/A  *N/A*      *N/A*
asym_packing     force     force      N/A    N/A  force      force
imbalanced       force     force      N/A    N/A  force      force
overloaded       force     force      N/A    N/A  force      avg_load

Fixes: 0b0695f2b34a ("sched/fair: Rework load_balance()")
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Tao Zhou <tao.zhou@linux.dev>
---

v1 changelog:
(1) Send to MAINTAINERS/REVIEWS get from `./scripts/get_maintainer.pl`
    suggested by Dietmar Eggemann.
(2) Based on v5.18-rc2


 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 d4bd299d67ab..b8c67e7c8cf3 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9495,7 +9495,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
  * busiest \ local has_spare fully_busy misfit asym imbalanced overloaded
  * has_spare        nr_idle   balanced   N/A    N/A  balanced   balanced
  * fully_busy       nr_idle   nr_idle    N/A    N/A  balanced   balanced
- * misfit_task      force     N/A        N/A    N/A  force      force
+ * misfit_task      force     N/A        N/A    N/A  N/A        N/A
  * asym_packing     force     force      N/A    N/A  force      force
  * imbalanced       force     force      N/A    N/A  force      force
  * overloaded       force     force      N/A    N/A  force      avg_load
-- 
2.35.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH V1 RESEND]: sched/fair: Revise comment about lb decision matrix
  2022-04-15  2:22 [PATCH V1 RESEND]: sched/fair: Revise comment about lb decision matrix Tao Zhou
@ 2022-04-15  8:32 ` Vincent Guittot
  2022-04-15 10:03   ` Tao Zhou
  2022-04-15 11:33   ` Peter Zijlstra
  0 siblings, 2 replies; 5+ messages in thread
From: Vincent Guittot @ 2022-04-15  8:32 UTC (permalink / raw)
  To: Tao Zhou
  Cc: LKML, Ingo Molnar, Peter Zijlstra, Juri Lelli, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira

On Fri, 15 Apr 2022 at 04:22, Tao Zhou <tao.zhou@linux.dev> wrote:
>
> If busiest group type is group_misfit_task, the local
> group type must be group_has_spare according to below
> code in update_sd_pick_busiest():
>
> if (sgs->group_type == group_misfit_task &&
>     (!capacity_greater(capacity_of(env->dst_cpu), sg->sgc->max_capacity) ||
>      sds->local_stat.group_type != group_has_spare))
>          return false;
>
> group type imbalanced and overloaded and fully_busy are filtered in here.
> misfit and asym are filtered before in update_sg_lb_stats().

The behavior has changed with
cad68e552e77 ("sched/fair: Consider misfit tasks when load-balancing")
But we haven't updated the matrix

Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>


> So, change the decision matrix to:
>
> busiest \ local has_spare fully_busy misfit asym imbalanced overloaded
> has_spare        nr_idle   balanced   N/A    N/A  balanced   balanced
> fully_busy       nr_idle   nr_idle    N/A    N/A  balanced   balanced
> misfit_task      force     N/A        N/A    N/A  *N/A*      *N/A*
> asym_packing     force     force      N/A    N/A  force      force
> imbalanced       force     force      N/A    N/A  force      force
> overloaded       force     force      N/A    N/A  force      avg_load
>
> Fixes: 0b0695f2b34a ("sched/fair: Rework load_balance()")
> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Signed-off-by: Tao Zhou <tao.zhou@linux.dev>
> ---
>
> v1 changelog:
> (1) Send to MAINTAINERS/REVIEWS get from `./scripts/get_maintainer.pl`
>     suggested by Dietmar Eggemann.
> (2) Based on v5.18-rc2
>
>
>  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 d4bd299d67ab..b8c67e7c8cf3 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -9495,7 +9495,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
>   * busiest \ local has_spare fully_busy misfit asym imbalanced overloaded
>   * has_spare        nr_idle   balanced   N/A    N/A  balanced   balanced
>   * fully_busy       nr_idle   nr_idle    N/A    N/A  balanced   balanced
> - * misfit_task      force     N/A        N/A    N/A  force      force
> + * misfit_task      force     N/A        N/A    N/A  N/A        N/A
>   * asym_packing     force     force      N/A    N/A  force      force
>   * imbalanced       force     force      N/A    N/A  force      force
>   * overloaded       force     force      N/A    N/A  force      avg_load
> --
> 2.35.2
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V1 RESEND]: sched/fair: Revise comment about lb decision matrix
  2022-04-15  8:32 ` Vincent Guittot
@ 2022-04-15 10:03   ` Tao Zhou
  2022-04-15 11:33   ` Peter Zijlstra
  1 sibling, 0 replies; 5+ messages in thread
From: Tao Zhou @ 2022-04-15 10:03 UTC (permalink / raw)
  To: Vincent Guittot, Tao Zhou
  Cc: LKML, Ingo Molnar, Peter Zijlstra, Juri Lelli, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira

On Fri, Apr 15, 2022 at 10:32:09AM +0200,
Vincent Guittot wrote:

> On Fri, 15 Apr 2022 at 04:22, Tao Zhou <tao.zhou@linux.dev> wrote:
> >
> > If busiest group type is group_misfit_task, the local
> > group type must be group_has_spare according to below
> > code in update_sd_pick_busiest():
> >
> > if (sgs->group_type == group_misfit_task &&
> >     (!capacity_greater(capacity_of(env->dst_cpu), sg->sgc->max_capacity) ||
> >      sds->local_stat.group_type != group_has_spare))
> >          return false;
> >
> > group type imbalanced and overloaded and fully_busy are filtered in here.
> > misfit and asym are filtered before in update_sg_lb_stats().
> 
> The behavior has changed with
> cad68e552e77 ("sched/fair: Consider misfit tasks when load-balancing")
> But we haven't updated the matrix
> 
> Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>

I send a version just now but forget to change the version number.

Thanks,
Tao

> > So, change the decision matrix to:
> >
> > busiest \ local has_spare fully_busy misfit asym imbalanced overloaded
> > has_spare        nr_idle   balanced   N/A    N/A  balanced   balanced
> > fully_busy       nr_idle   nr_idle    N/A    N/A  balanced   balanced
> > misfit_task      force     N/A        N/A    N/A  *N/A*      *N/A*
> > asym_packing     force     force      N/A    N/A  force      force
> > imbalanced       force     force      N/A    N/A  force      force
> > overloaded       force     force      N/A    N/A  force      avg_load
> >
> > Fixes: 0b0695f2b34a ("sched/fair: Rework load_balance()")
> > Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
> > Signed-off-by: Tao Zhou <tao.zhou@linux.dev>
> > ---
> >
> > v1 changelog:
> > (1) Send to MAINTAINERS/REVIEWS get from `./scripts/get_maintainer.pl`
> >     suggested by Dietmar Eggemann.
> > (2) Based on v5.18-rc2
> >
> >
> >  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 d4bd299d67ab..b8c67e7c8cf3 100644
> > --- a/kernel/sched/fair.c
> > +++ b/kernel/sched/fair.c
> > @@ -9495,7 +9495,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
> >   * busiest \ local has_spare fully_busy misfit asym imbalanced overloaded
> >   * has_spare        nr_idle   balanced   N/A    N/A  balanced   balanced
> >   * fully_busy       nr_idle   nr_idle    N/A    N/A  balanced   balanced
> > - * misfit_task      force     N/A        N/A    N/A  force      force
> > + * misfit_task      force     N/A        N/A    N/A  N/A        N/A
> >   * asym_packing     force     force      N/A    N/A  force      force
> >   * imbalanced       force     force      N/A    N/A  force      force
> >   * overloaded       force     force      N/A    N/A  force      avg_load
> > --
> > 2.35.2
> >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V1 RESEND]: sched/fair: Revise comment about lb decision matrix
  2022-04-15  8:32 ` Vincent Guittot
  2022-04-15 10:03   ` Tao Zhou
@ 2022-04-15 11:33   ` Peter Zijlstra
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Zijlstra @ 2022-04-15 11:33 UTC (permalink / raw)
  To: Vincent Guittot
  Cc: Tao Zhou, LKML, Ingo Molnar, Juri Lelli, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira

On Fri, Apr 15, 2022 at 10:32:09AM +0200, Vincent Guittot wrote:
> On Fri, 15 Apr 2022 at 04:22, Tao Zhou <tao.zhou@linux.dev> wrote:
> >
> > If busiest group type is group_misfit_task, the local
> > group type must be group_has_spare according to below
> > code in update_sd_pick_busiest():
> >
> > if (sgs->group_type == group_misfit_task &&
> >     (!capacity_greater(capacity_of(env->dst_cpu), sg->sgc->max_capacity) ||
> >      sds->local_stat.group_type != group_has_spare))
> >          return false;
> >
> > group type imbalanced and overloaded and fully_busy are filtered in here.
> > misfit and asym are filtered before in update_sg_lb_stats().
> 
> The behavior has changed with
> cad68e552e77 ("sched/fair: Consider misfit tasks when load-balancing")
> But we haven't updated the matrix
> 
> Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>

Thanks (I took the later version and stuck your Rb on)!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH V1 RESEND]: sched/fair: Revise comment about lb decision matrix
@ 2022-04-15  9:55 Tao Zhou
  0 siblings, 0 replies; 5+ messages in thread
From: Tao Zhou @ 2022-04-15  9:55 UTC (permalink / raw)
  To: LKML, Tao Zhou
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, Morten Rasmussen, Valentin Schneider

If busiest group type is group_misfit_task, the local
group type must be group_has_spare according to below
code in update_sd_pick_busiest():

if (sgs->group_type == group_misfit_task &&
    (!capacity_greater(capacity_of(env->dst_cpu), sg->sgc->max_capacity) ||
     sds->local_stat.group_type != group_has_spare))
         return false;

group type imbalanced and overloaded and fully_busy are filtered in here.
misfit and asym are filtered before in update_sg_lb_stats().
So, change the decision matrix to:

busiest \ local has_spare fully_busy misfit asym imbalanced overloaded
has_spare        nr_idle   balanced   N/A    N/A  balanced   balanced
fully_busy       nr_idle   nr_idle    N/A    N/A  balanced   balanced
misfit_task      force     N/A        N/A    N/A  *N/A*      *N/A*
asym_packing     force     force      N/A    N/A  force      force
imbalanced       force     force      N/A    N/A  force      force
overloaded       force     force      N/A    N/A  force      avg_load

Fixes: 0b0695f2b34a ("sched/fair: Rework load_balance()")
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Tao Zhou <tao.zhou@linux.dev>
---

v1 changelog:
(1) Send to MAINTAINERS/REVIEWS get from `./scripts/get_maintainer.pl`
    suggested by Dietmar Eggemann.
(2) Based on v5.18-rc2

v1->v2 changelog:
(1) Add Reviewed-by from Vincent Guittot.
(2) This behavior has changed with
    cad68e552e77 ("sched/fair: Consider misfit tasks when load-balancing")
    and the matrix has not changed.
    Add the related people of commit cad68e552e77 to the cc list.

 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 d4bd299d67ab..b8c67e7c8cf3 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9495,7 +9495,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
  * busiest \ local has_spare fully_busy misfit asym imbalanced overloaded
  * has_spare        nr_idle   balanced   N/A    N/A  balanced   balanced
  * fully_busy       nr_idle   nr_idle    N/A    N/A  balanced   balanced
- * misfit_task      force     N/A        N/A    N/A  force      force
+ * misfit_task      force     N/A        N/A    N/A  N/A        N/A
  * asym_packing     force     force      N/A    N/A  force      force
  * imbalanced       force     force      N/A    N/A  force      force
  * overloaded       force     force      N/A    N/A  force      avg_load
-- 
2.35.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-15 11:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15  2:22 [PATCH V1 RESEND]: sched/fair: Revise comment about lb decision matrix Tao Zhou
2022-04-15  8:32 ` Vincent Guittot
2022-04-15 10:03   ` Tao Zhou
2022-04-15 11:33   ` Peter Zijlstra
2022-04-15  9:55 Tao Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).