Skip to contentSkip to conversation

sched/deadline: Exclude special DL entities from bandwidth moves

PATCH Superseded Guopeng Zhang 3 participants 4 messages May 28 – Jun 29 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/deadline: Exclude special DL entities from bandwidth moves

From: Guopeng Zhang <[email protected]>

SUGOV special DL entities use fake/unused bandwidth. They are already excluded from regular DL admission control, affinity admission checks, rq bandwidth accounting, and root-domain rebuild accounting.

dl_task_needs_bw_move() misses the same exclusion. As a result, set_cpus_allowed_dl() and cpuset attach may treat a special DL entity as requiring a root-domain bandwidth move when its affinity mask no longer intersects the source root domain.

Return false for special DL entities so root-domain bandwidth move accounting follows the rest of the SUGOV special-entity handling.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +1 -1
index ddfd6bc63ab1..3653166caa69 100644
@@ -3142,7 +3142,7 @@ static void set_cpus_allowed_dl(struct task_struct *p,
 bool dl_task_needs_bw_move(struct task_struct *p,
 			   const struct cpumask *new_mask)
 {
-	if (!dl_task(p))
+	if (!dl_task(p) || dl_entity_is_special(&p->dl))
 		return false;
 
 	return !cpumask_intersects(task_rq(p)->rd->span, new_mask);
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Guopeng Zhang

From: Guopeng Zhang <[email protected]>

SUGOV special DL entities use fake/unused bandwidth. They are already excluded from regular DL admission control, affinity admission checks, rq bandwidth accounting, and root-domain rebuild accounting.

dl_task_needs_bw_move() misses the same exclusion. As a result, set_cpus_allowed_dl() and cpuset attach may treat a special DL entity as requiring a root-domain bandwidth move when its affinity mask no longer intersects the source root domain.

Return false for special DL entities so root-domain bandwidth move accounting follows the rest of the SUGOV special-entity handling.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +0 -0
index ddfd6bc63ab1..3653166caa69 100644

kernel/sched/deadline.c static void set_cpus_allowed_dl(struct task_struct *p, · line 3148

Quoted 8 lines
kernel/sched/deadline.c +1 -1
@@ -3142,7 +3142,7 @@ static void set_cpus_allowed_dl(struct task_struct *p,
 bool dl_task_needs_bw_move(struct task_struct *p,
 			   const struct cpumask *new_mask)
 {
-	if (!dl_task(p))
+	if (!dl_task(p) || dl_entity_is_special(&p->dl))
 		return false;
 
 	return !cpumask_intersects(task_rq(p)->rd->span, new_mask);

FWIW I don't see an issue excluding sugov here:

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Guopeng Zhang

Hello!

Quoted 24 lines · Guopeng Zhang

From: Guopeng Zhang <[email protected]>

SUGOV special DL entities use fake/unused bandwidth. They are already excluded from regular DL admission control, affinity admission checks, rq bandwidth accounting, and root-domain rebuild accounting.

dl_task_needs_bw_move() misses the same exclusion. As a result, set_cpus_allowed_dl() and cpuset attach may treat a special DL entity as requiring a root-domain bandwidth move when its affinity mask no longer intersects the source root domain.

Return false for special DL entities so root-domain bandwidth move accounting follows the rest of the SUGOV special-entity handling.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +0 -0
index ddfd6bc63ab1..3653166caa69 100644

kernel/sched/deadline.c static void set_cpus_allowed_dl(struct task_struct *p, · line 3148

Quoted 8 lines
kernel/sched/deadline.c +1 -1
@@ -3142,7 +3142,7 @@ static void set_cpus_allowed_dl(struct task_struct *p,
 bool dl_task_needs_bw_move(struct task_struct *p,
 			   const struct cpumask *new_mask)
 {
-	if (!dl_task(p))
+	if (!dl_task(p) || dl_entity_is_special(&p->dl))
 		return false;
 
 	return !cpumask_intersects(task_rq(p)->rd->span, new_mask);

Makes sense to me.

Best,
Juri

#3 lore raw

Hi Peter, Ingo,

Gentle ping on this patch.

It has received Reviewed-by from Christian and Acked-by from Juri. Do you think it is suitable for the sched/core tree, or is there anything else I should change?

Thanks,
Guopeng

Quoted 43 lines · Juri Lelli

Hello!

Quoted 24 lines · Guopeng Zhang

From: Guopeng Zhang <[email protected]>

SUGOV special DL entities use fake/unused bandwidth. They are already excluded from regular DL admission control, affinity admission checks, rq bandwidth accounting, and root-domain rebuild accounting.

dl_task_needs_bw_move() misses the same exclusion. As a result, set_cpus_allowed_dl() and cpuset attach may treat a special DL entity as requiring a root-domain bandwidth move when its affinity mask no longer intersects the source root domain.

Return false for special DL entities so root-domain bandwidth move accounting follows the rest of the SUGOV special-entity handling.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +0 -0
index ddfd6bc63ab1..3653166caa69 100644

kernel/sched/deadline.c static void set_cpus_allowed_dl(struct task_struct *p, · line 3148

Quoted 8 lines
kernel/sched/deadline.c +1 -1
@@ -3142,7 +3142,7 @@ static void set_cpus_allowed_dl(struct task_struct *p,
 bool dl_task_needs_bw_move(struct task_struct *p,
 			   const struct cpumask *new_mask)
 {
-	if (!dl_task(p))
+	if (!dl_task(p) || dl_entity_is_special(&p->dl))
 		return false;
 
 	return !cpumask_intersects(task_rq(p)->rd->span, new_mask);

Makes sense to me.

Best,
Juri