All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
@ 2022-01-18 10:05 ` Tianchen Ding
  0 siblings, 0 replies; 8+ messages in thread
From: Tianchen Ding @ 2022-01-18 10:05 UTC (permalink / raw)
  To: Zefan Li, Tejun Heo, Johannes Weiner, Waiman Long,
	Peter Zijlstra (Intel)
  Cc: cgroups, linux-kernel

subparts_cpus should be limited as a subset of cpus_allowed, but it is
updated wrongly by using cpumask_andnot(). Use cpumask_and() instead to
fix it.

Fixes: ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag")
Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com>
---
 kernel/cgroup/cpuset.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index bb3531e7fda7..804ff5738c5f 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1635,8 +1635,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
 	 * Make sure that subparts_cpus is a subset of cpus_allowed.
 	 */
 	if (cs->nr_subparts_cpus) {
-		cpumask_andnot(cs->subparts_cpus, cs->subparts_cpus,
-			       cs->cpus_allowed);
+		cpumask_and(cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed);
 		cs->nr_subparts_cpus = cpumask_weight(cs->subparts_cpus);
 	}
 	spin_unlock_irq(&callback_lock);
-- 
2.33.0


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

* [PATCH] cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
@ 2022-01-18 10:05 ` Tianchen Ding
  0 siblings, 0 replies; 8+ messages in thread
From: Tianchen Ding @ 2022-01-18 10:05 UTC (permalink / raw)
  To: Zefan Li, Tejun Heo, Johannes Weiner, Waiman Long,
	Peter Zijlstra (Intel)
  Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA

subparts_cpus should be limited as a subset of cpus_allowed, but it is
updated wrongly by using cpumask_andnot(). Use cpumask_and() instead to
fix it.

Fixes: ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag")
Signed-off-by: Tianchen Ding <dtcccc-KPsoFbNs7GizrGE5bRqYAgC/G2K4zDHf@public.gmane.org>
---
 kernel/cgroup/cpuset.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index bb3531e7fda7..804ff5738c5f 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1635,8 +1635,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
 	 * Make sure that subparts_cpus is a subset of cpus_allowed.
 	 */
 	if (cs->nr_subparts_cpus) {
-		cpumask_andnot(cs->subparts_cpus, cs->subparts_cpus,
-			       cs->cpus_allowed);
+		cpumask_and(cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed);
 		cs->nr_subparts_cpus = cpumask_weight(cs->subparts_cpus);
 	}
 	spin_unlock_irq(&callback_lock);
-- 
2.33.0


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

* Re: [PATCH] cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
@ 2022-01-18 20:21   ` Waiman Long
  0 siblings, 0 replies; 8+ messages in thread
From: Waiman Long @ 2022-01-18 20:21 UTC (permalink / raw)
  To: Tianchen Ding, Zefan Li, Tejun Heo, Johannes Weiner,
	Peter Zijlstra (Intel)
  Cc: cgroups, linux-kernel

On 1/18/22 05:05, Tianchen Ding wrote:
> subparts_cpus should be limited as a subset of cpus_allowed, but it is
> updated wrongly by using cpumask_andnot(). Use cpumask_and() instead to
> fix it.
>
> Fixes: ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag")
> Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com>
> ---
>   kernel/cgroup/cpuset.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index bb3531e7fda7..804ff5738c5f 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -1635,8 +1635,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
>   	 * Make sure that subparts_cpus is a subset of cpus_allowed.
>   	 */
>   	if (cs->nr_subparts_cpus) {
> -		cpumask_andnot(cs->subparts_cpus, cs->subparts_cpus,
> -			       cs->cpus_allowed);
> +		cpumask_and(cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed);
>   		cs->nr_subparts_cpus = cpumask_weight(cs->subparts_cpus);
>   	}
>   	spin_unlock_irq(&callback_lock);

Thanks for the fix.

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


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

* Re: [PATCH] cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
@ 2022-01-18 20:21   ` Waiman Long
  0 siblings, 0 replies; 8+ messages in thread
From: Waiman Long @ 2022-01-18 20:21 UTC (permalink / raw)
  To: Tianchen Ding, Zefan Li, Tejun Heo, Johannes Weiner,
	Peter Zijlstra (Intel)
  Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 1/18/22 05:05, Tianchen Ding wrote:
> subparts_cpus should be limited as a subset of cpus_allowed, but it is
> updated wrongly by using cpumask_andnot(). Use cpumask_and() instead to
> fix it.
>
> Fixes: ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag")
> Signed-off-by: Tianchen Ding <dtcccc-KPsoFbNs7GizrGE5bRqYAgC/G2K4zDHf@public.gmane.org>
> ---
>   kernel/cgroup/cpuset.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index bb3531e7fda7..804ff5738c5f 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -1635,8 +1635,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
>   	 * Make sure that subparts_cpus is a subset of cpus_allowed.
>   	 */
>   	if (cs->nr_subparts_cpus) {
> -		cpumask_andnot(cs->subparts_cpus, cs->subparts_cpus,
> -			       cs->cpus_allowed);
> +		cpumask_and(cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed);
>   		cs->nr_subparts_cpus = cpumask_weight(cs->subparts_cpus);
>   	}
>   	spin_unlock_irq(&callback_lock);

Thanks for the fix.

Reviewed-by: Waiman Long <longman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>


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

* Re: [PATCH] cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
@ 2022-01-26  2:17   ` Tianchen Ding
  0 siblings, 0 replies; 8+ messages in thread
From: Tianchen Ding @ 2022-01-26  2:17 UTC (permalink / raw)
  To: Zefan Li, Tejun Heo, Johannes Weiner, Waiman Long,
	Peter Zijlstra (Intel)
  Cc: cgroups, linux-kernel

Ping~
Any maintainer take a look?

On 2022/1/18 18:05, Tianchen Ding wrote:
> subparts_cpus should be limited as a subset of cpus_allowed, but it is
> updated wrongly by using cpumask_andnot(). Use cpumask_and() instead to
> fix it.
> 
> Fixes: ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag")
> Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com>
> ---
>   kernel/cgroup/cpuset.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index bb3531e7fda7..804ff5738c5f 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -1635,8 +1635,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
>   	 * Make sure that subparts_cpus is a subset of cpus_allowed.
>   	 */
>   	if (cs->nr_subparts_cpus) {
> -		cpumask_andnot(cs->subparts_cpus, cs->subparts_cpus,
> -			       cs->cpus_allowed);
> +		cpumask_and(cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed);
>   		cs->nr_subparts_cpus = cpumask_weight(cs->subparts_cpus);
>   	}
>   	spin_unlock_irq(&callback_lock);


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

* Re: [PATCH] cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
@ 2022-01-26  2:17   ` Tianchen Ding
  0 siblings, 0 replies; 8+ messages in thread
From: Tianchen Ding @ 2022-01-26  2:17 UTC (permalink / raw)
  To: Zefan Li, Tejun Heo, Johannes Weiner, Waiman Long,
	Peter Zijlstra (Intel)
  Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA

Ping~
Any maintainer take a look?

On 2022/1/18 18:05, Tianchen Ding wrote:
> subparts_cpus should be limited as a subset of cpus_allowed, but it is
> updated wrongly by using cpumask_andnot(). Use cpumask_and() instead to
> fix it.
> 
> Fixes: ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag")
> Signed-off-by: Tianchen Ding <dtcccc-KPsoFbNs7GizrGE5bRqYAgC/G2K4zDHf@public.gmane.org>
> ---
>   kernel/cgroup/cpuset.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index bb3531e7fda7..804ff5738c5f 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -1635,8 +1635,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
>   	 * Make sure that subparts_cpus is a subset of cpus_allowed.
>   	 */
>   	if (cs->nr_subparts_cpus) {
> -		cpumask_andnot(cs->subparts_cpus, cs->subparts_cpus,
> -			       cs->cpus_allowed);
> +		cpumask_and(cs->subparts_cpus, cs->subparts_cpus, cs->cpus_allowed);
>   		cs->nr_subparts_cpus = cpumask_weight(cs->subparts_cpus);
>   	}
>   	spin_unlock_irq(&callback_lock);


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

* Re: [PATCH] cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
@ 2022-01-26 16:49   ` Tejun Heo
  0 siblings, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2022-01-26 16:49 UTC (permalink / raw)
  To: Tianchen Ding
  Cc: Zefan Li, Johannes Weiner, Waiman Long, Peter Zijlstra (Intel),
	cgroups, linux-kernel

On Tue, Jan 18, 2022 at 06:05:18PM +0800, Tianchen Ding wrote:
> subparts_cpus should be limited as a subset of cpus_allowed, but it is
> updated wrongly by using cpumask_andnot(). Use cpumask_and() instead to
> fix it.
> 
> Fixes: ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag")
> Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com>

Applied to cgroup/for-5.17-fixes.

Thanks.

-- 
tejun

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

* Re: [PATCH] cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask()
@ 2022-01-26 16:49   ` Tejun Heo
  0 siblings, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2022-01-26 16:49 UTC (permalink / raw)
  To: Tianchen Ding
  Cc: Zefan Li, Johannes Weiner, Waiman Long, Peter Zijlstra (Intel),
	cgroups-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Tue, Jan 18, 2022 at 06:05:18PM +0800, Tianchen Ding wrote:
> subparts_cpus should be limited as a subset of cpus_allowed, but it is
> updated wrongly by using cpumask_andnot(). Use cpumask_and() instead to
> fix it.
> 
> Fixes: ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag")
> Signed-off-by: Tianchen Ding <dtcccc-KPsoFbNs7GizrGE5bRqYAgC/G2K4zDHf@public.gmane.org>

Applied to cgroup/for-5.17-fixes.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2022-01-26 16:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 10:05 [PATCH] cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask() Tianchen Ding
2022-01-18 10:05 ` Tianchen Ding
2022-01-18 20:21 ` Waiman Long
2022-01-18 20:21   ` Waiman Long
2022-01-26  2:17 ` Tianchen Ding
2022-01-26  2:17   ` Tianchen Ding
2022-01-26 16:49 ` Tejun Heo
2022-01-26 16:49   ` Tejun Heo

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.