Skip to contentSkip to conversation

: sched/fair: Revise comment about lb decision matrix

PATCH RESEND Superseded Tao Zhou 3 participants 4 messages Apr 15, 2022 Scheduler

lore
Share & tools
lore

Tao Zhou

author
#0 lore raw

PATCH RESEND 1/1 : sched/fair: Revise comment about lb decision matrix

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()")

---

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(-)
kernel/sched/fair.c +1 -1
index d4bd299d67ab..b8c67e7c8cf3 100644
@@ -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
Signature · 1 line
2.35.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Tao Zhou

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():

Quoted 7 lines

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

Quoted 40 lines

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()")

---

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(-)
kernel/sched/fair.c +1 -2
index d4bd299d67ab..b8c67e7c8cf3 100644
@@ -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

author
#2 lore raw
Quoted 11 lines · Vincent Guittot
Quoted 10 lines · Tao Zhou

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;
Quoted 8 lines
Quoted 2 lines

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

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

Thanks,
Tao

Quoted 40 lines
Quoted 40 lines

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()")

---

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(-)
kernel/sched/fair.c +1 -2
index d4bd299d67ab..b8c67e7c8cf3 100644
@@ -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

maintainer
#3 lore raw
In reply to Vincent Guittot
Quoted 11 lines · Vincent Guittot
Quoted 10 lines · Tao Zhou

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;
Quoted 8 lines
Quoted 2 lines

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

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