The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] sched/deadline: Exclude special DL entities from bandwidth moves
@ 2026-05-28  6:53 Guopeng Zhang
  2026-05-28  9:47 ` Christian Loehle
  2026-05-28 12:24 ` Juri Lelli
  0 siblings, 2 replies; 4+ messages in thread
From: Guopeng Zhang @ 2026-05-28  6:53 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
  Cc: Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, K Prateek Nayak, linux-kernel, Guopeng Zhang

From: Guopeng Zhang <zhangguopeng@kylinos.cn>

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.

Signed-off-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index ddfd6bc63ab1..3653166caa69 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -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);
-- 
2.43.0


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

* Re: [PATCH] sched/deadline: Exclude special DL entities from bandwidth moves
  2026-05-28  6:53 [PATCH] sched/deadline: Exclude special DL entities from bandwidth moves Guopeng Zhang
@ 2026-05-28  9:47 ` Christian Loehle
  2026-05-28 12:24 ` Juri Lelli
  1 sibling, 0 replies; 4+ messages in thread
From: Christian Loehle @ 2026-05-28  9:47 UTC (permalink / raw)
  To: Guopeng Zhang, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot
  Cc: Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Valentin Schneider, K Prateek Nayak, linux-kernel, Guopeng Zhang

On 5/28/26 07:53, Guopeng Zhang wrote:
> From: Guopeng Zhang <zhangguopeng@kylinos.cn>
> 
> 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.
> 
> Signed-off-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
> ---
>  kernel/sched/deadline.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index ddfd6bc63ab1..3653166caa69 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -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:
Reviewed-by: Christian Loehle <christian.loehle@arm.com>

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

* Re: [PATCH] sched/deadline: Exclude special DL entities from bandwidth moves
  2026-05-28  6:53 [PATCH] sched/deadline: Exclude special DL entities from bandwidth moves Guopeng Zhang
  2026-05-28  9:47 ` Christian Loehle
@ 2026-05-28 12:24 ` Juri Lelli
  2026-06-29  5:43   ` Guopeng Zhang
  1 sibling, 1 reply; 4+ messages in thread
From: Juri Lelli @ 2026-05-28 12:24 UTC (permalink / raw)
  To: Guopeng Zhang
  Cc: Ingo Molnar, Peter Zijlstra, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman, Valentin Schneider,
	K Prateek Nayak, linux-kernel, Guopeng Zhang

Hello!

On 28/05/26 14:53, Guopeng Zhang wrote:
> From: Guopeng Zhang <zhangguopeng@kylinos.cn>
> 
> 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.
> 
> Signed-off-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
> ---
>  kernel/sched/deadline.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index ddfd6bc63ab1..3653166caa69 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -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.

Acked-by: Juri Lelli <juri.lelli@redhat.com>

Best,
Juri


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

* Re: [PATCH] sched/deadline: Exclude special DL entities from bandwidth moves
  2026-05-28 12:24 ` Juri Lelli
@ 2026-06-29  5:43   ` Guopeng Zhang
  0 siblings, 0 replies; 4+ messages in thread
From: Guopeng Zhang @ 2026-06-29  5:43 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli
  Cc: Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, K Prateek Nayak, linux-kernel,
	Guopeng Zhang, Christian Loehle

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

在 2026/5/28 20:24, Juri Lelli 写道:
> Hello!
> 
> On 28/05/26 14:53, Guopeng Zhang wrote:
>> From: Guopeng Zhang <zhangguopeng@kylinos.cn>
>>
>> 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.
>>
>> Signed-off-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
>> ---
>>  kernel/sched/deadline.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
>> index ddfd6bc63ab1..3653166caa69 100644
>> --- a/kernel/sched/deadline.c
>> +++ b/kernel/sched/deadline.c
>> @@ -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.
> 
> Acked-by: Juri Lelli <juri.lelli@redhat.com>
> 
> Best,
> Juri
> 


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

end of thread, other threads:[~2026-06-29  5:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28  6:53 [PATCH] sched/deadline: Exclude special DL entities from bandwidth moves Guopeng Zhang
2026-05-28  9:47 ` Christian Loehle
2026-05-28 12:24 ` Juri Lelli
2026-06-29  5:43   ` Guopeng Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox