LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice
@ 2024-04-23  2:44 Xiu Jianfeng
  2024-04-23  2:53 ` Waiman Long
  2024-04-23 16:01 ` Tejun Heo
  0 siblings, 2 replies; 3+ messages in thread
From: Xiu Jianfeng @ 2024-04-23  2:44 UTC (permalink / raw
  To: longman, lizefan.x, tj, hannes; +Cc: cgroups, linux-kernel

In cpuset_css_online(), CS_SCHED_LOAD_BALANCE will be cleared twice,
the former one in the is_in_v2_mode() case could be removed because
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.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>

---
v2: remove the one in is_in_v2_mode() case.
---
 kernel/cgroup/cpuset.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index d8d3439eda4e..bb9bf25889c9 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -4051,11 +4051,6 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
 		cs->effective_mems = parent->effective_mems;
 		cs->use_parent_ecpus = true;
 		parent->child_ecpus_count++;
-		/*
-		 * Clear CS_SCHED_LOAD_BALANCE if parent is isolated
-		 */
-		if (!is_sched_load_balance(parent))
-			clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags);
 	}
 
 	/*
-- 
2.34.1


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

* Re: [PATCH v2 -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice
  2024-04-23  2:44 [PATCH v2 -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice Xiu Jianfeng
@ 2024-04-23  2:53 ` Waiman Long
  2024-04-23 16:01 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Waiman Long @ 2024-04-23  2:53 UTC (permalink / raw
  To: Xiu Jianfeng, lizefan.x, tj, hannes; +Cc: cgroups, linux-kernel

On 4/22/24 22:44, Xiu Jianfeng wrote:
> In cpuset_css_online(), CS_SCHED_LOAD_BALANCE will be cleared twice,
> the former one in the is_in_v2_mode() case could be removed because
> 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.
>
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
>
> ---
> v2: remove the one in is_in_v2_mode() case.
> ---
>   kernel/cgroup/cpuset.c | 5 -----
>   1 file changed, 5 deletions(-)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index d8d3439eda4e..bb9bf25889c9 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -4051,11 +4051,6 @@ static int cpuset_css_online(struct cgroup_subsys_state *css)
>   		cs->effective_mems = parent->effective_mems;
>   		cs->use_parent_ecpus = true;
>   		parent->child_ecpus_count++;
> -		/*
> -		 * Clear CS_SCHED_LOAD_BALANCE if parent is isolated
> -		 */
> -		if (!is_sched_load_balance(parent))
> -			clear_bit(CS_SCHED_LOAD_BALANCE, &cs->flags);
>   	}
>   
>   	/*

Thank for the v2.

Reviewed-by: Waiman Long <longman@redhat.com>


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

* Re: [PATCH v2 -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice
  2024-04-23  2:44 [PATCH v2 -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice Xiu Jianfeng
  2024-04-23  2:53 ` Waiman Long
@ 2024-04-23 16:01 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2024-04-23 16:01 UTC (permalink / raw
  To: Xiu Jianfeng; +Cc: longman, lizefan.x, hannes, cgroups, linux-kernel

On Tue, Apr 23, 2024 at 02:44:39AM +0000, Xiu Jianfeng wrote:
> In cpuset_css_online(), CS_SCHED_LOAD_BALANCE will be cleared twice,
> the former one in the is_in_v2_mode() case could be removed because
> 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.
> 
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>

Applied to cgroup/for-6.10.

Thanks.

-- 
tejun

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23  2:44 [PATCH v2 -next] cgroup/cpuset: Avoid clearing CS_SCHED_LOAD_BALANCE twice Xiu Jianfeng
2024-04-23  2:53 ` Waiman Long
2024-04-23 16:01 ` Tejun Heo

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 read-only IMAP folder(s) and NNTP newsgroup(s).