All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice
@ 2024-04-20  9:47 Xiu Jianfeng
  2024-04-22 18:38 ` Waiman Long
  0 siblings, 1 reply; 3+ messages in thread
From: Xiu Jianfeng @ 2024-04-20  9:47 UTC (permalink / raw
  To: longman, lizefan.x, tj, hannes; +Cc: cgroups, linux-kernel

In cpuset_css_online(), CS_SCHED_LOAD_BALANCE has been cleared in the
is_in_v2_mode() case under the same condition, don't do it twice.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
 kernel/cgroup/cpuset.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index e70008a1d86a..159525cdaeb9 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -4059,13 +4059,6 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
 			clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags);
 	}
 
-	/*
-	 * For v2, clear CS_SCHED_LOAD_BALANCE if parent is isolated
-	 */
-	if (cgroup_subsys_on_dfl(cpuset_cgrp_subsys) &&
-	    !is_sched_load_balance(parent))
-		clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags);
-
 	spin_unlock_irq(&callback_lock);
 
 	if (!test_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags))
-- 
2.34.1


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

* Re: [PATCH -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice
  2024-04-20  9:47 [PATCH -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice Xiu Jianfeng
@ 2024-04-22 18:38 ` Waiman Long
  2024-04-23  1:40   ` xiujianfeng
  0 siblings, 1 reply; 3+ messages in thread
From: Waiman Long @ 2024-04-22 18:38 UTC (permalink / raw
  To: Xiu Jianfeng, lizefan.x, tj, hannes; +Cc: cgroups, linux-kernel

On 4/20/24 05:47, Xiu Jianfeng wrote:
> In cpuset_css_online(), CS_SCHED_LOAD_BALANCE has been cleared in the
> is_in_v2_mode() case under the same condition, don't do it twice.
>
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
> ---
>   kernel/cgroup/cpuset.c | 7 -------
>   1 file changed, 7 deletions(-)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index e70008a1d86a..159525cdaeb9 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -4059,13 +4059,6 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
>   			clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags);
>   	}
>   
> -	/*
> -	 * For v2, clear CS_SCHED_LOAD_BALANCE if parent is isolated
> -	 */
> -	if (cgroup_subsys_on_dfl(cpuset_cgrp_subsys) &&
> -	    !is_sched_load_balance(parent))
> -		clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags);
> -
>   	spin_unlock_irq(&callback_lock);
>   
>   	if (!test_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags))

Thanks for catching this duplication.

Could you remove the check inside is_in_v2_mode() instead? 
is_in_v2_mode() can be true for cgroup v1 if the"cpuset_v2_mode" mount 
option is specified. That balance flag change isn't appropriate for this 
particular case.

Thanks,
Longman


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

* Re: [PATCH -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice
  2024-04-22 18:38 ` Waiman Long
@ 2024-04-23  1:40   ` xiujianfeng
  0 siblings, 0 replies; 3+ messages in thread
From: xiujianfeng @ 2024-04-23  1:40 UTC (permalink / raw
  To: Waiman Long, lizefan.x, tj, hannes; +Cc: cgroups, linux-kernel



On 2024/4/23 2:38, Waiman Long wrote:
> On 4/20/24 05:47, Xiu Jianfeng wrote:
>> In cpuset_css_online(), CS_SCHED_LOAD_BALANCE has been cleared in the
>> is_in_v2_mode() case under the same condition, don't do it twice.
>>
>> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
>> ---
>>   kernel/cgroup/cpuset.c | 7 -------
>>   1 file changed, 7 deletions(-)
>>
>> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
>> index e70008a1d86a..159525cdaeb9 100644
>> --- a/kernel/cgroup/cpuset.c
>> +++ b/kernel/cgroup/cpuset.c
>> @@ -4059,13 +4059,6 @@ static int cpuset_css_online(struct
>> cgroup_subsys_state *css)
>>               clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags);
>>       }
>>   -    /*
>> -     * For v2, clear CS_SCHED_LOAD_BALANCE if parent is isolated
>> -     */
>> -    if (cgroup_subsys_on_dfl(cpuset_cgrp_subsys) &&
>> -        !is_sched_load_balance(parent))
>> -        clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags);
>> -
>>       spin_unlock_irq(&callback_lock);
>>         if (!test_bit(CGRP_CPUSET_CLONE_CHILDREN, &css->cgroup->flags))
> 
> Thanks for catching this duplication.
> 
> Could you remove the check inside is_in_v2_mode() instead?
> is_in_v2_mode() can be true for cgroup v1 if the"cpuset_v2_mode" mount
> option is specified. That balance flag change isn't appropriate for this
> particular case.

Sure, thanks for explanation, will do in v2.

> 
> Thanks,
> Longman
> 

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

end of thread, other threads:[~2024-04-23  1:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-20  9:47 [PATCH -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice Xiu Jianfeng
2024-04-22 18:38 ` Waiman Long
2024-04-23  1:40   ` xiujianfeng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.