From: Guopeng Zhang <guopeng.zhang@linux.dev>
To: "Waiman Long" <longman@redhat.com>,
"Ridong Chen" <ridong.chen@linux.dev>,
"Tejun Heo" <tj@kernel.org>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Shuah Khan" <shuah@kernel.org>
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v2 2/3] cgroup/cpuset: Recompute effective cpumask in update_cpumasks_hier() after calling update_parent_effective_cpumask()
Date: Mon, 2 Nov 2026 09:28:53 +0800 [thread overview]
Message-ID: <c4b63601-ab06-4ee0-8d15-4c4acfa35f81@linux.dev> (raw)
In-Reply-To: <20261030190701.78308-3-longman@redhat.com>
在 2026/10/31 03:07, Waiman Long 写道:
> It is reported by sashiko that calling update_parent_effective_cpumask()
> may clobber tmp->new_cpus when update_sibling_cpumasks() needs to be
> called due to possible change in the parent's effective_cpus value.
> Therefore the new effective cpumask has to be recomputed after calling
> update_parent_effective_cpumask() to get a correct value back into
> tmp->new_cpus.
>
> Fixes: f0af1bfc27b5 ("cgroup/cpuset: Relax constraints to partition & cpus changes")
> Signed-off-by: Waiman Long <longman@redhat.com>
> ---
> kernel/cgroup/cpuset.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index 39c81a0a8ab9..ed014ecb770c 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -2359,12 +2359,12 @@ static void update_cpumasks_hier(struct cpuset *cs, struct tmpmasks *tmp,
> update_parent_effective_cpumask(cp, partcmd_update, NULL, tmp);
> /*
> * Capture current partition_root_state as it may have
> - * changed. Recompute effective cpumask if changed.
> + * changed. Always recompute effective cpumask as tmp->new_cpus
> + * may be clobbered when update_sibling_cpumasks() is called
> + * within update_parent_effective_cpumask().
> */
> new_prs = cp->partition_root_state;
> - if (new_prs != old_prs) {
> - compute_effective_cpumask(tmp->new_cpus, cp, parent);
> - }
> + compute_effective_cpumask(tmp->new_cpus, cp, parent);
> }
>
> spin_lock_irq(&callback_lock);
Reviewed-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Tested-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Thanks,
Guopeng
next prev parent reply other threads:[~2026-11-02 1:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 19:06 [PATCH v2 0/3] cgroup/cpuset: Fix some more bugs in cpuset partition code Waiman Long
2026-10-30 19:06 ` [PATCH v2 1/3] cgroup/cpuset: Fix incorrect CPU accounting with parent's effective_xcpus expansion Waiman Long
2026-11-02 1:28 ` Guopeng Zhang
2026-10-30 19:07 ` [PATCH v2 2/3] cgroup/cpuset: Recompute effective cpumask in update_cpumasks_hier() after calling update_parent_effective_cpumask() Waiman Long
2026-11-02 1:28 ` Guopeng Zhang [this message]
2026-10-30 19:07 ` [PATCH v2 3/3] cgroup/cpuset: Do housekeeping check when isolated child with root parent may get more xcpus Waiman Long
2026-11-02 1:30 ` Guopeng Zhang
2026-11-02 8:04 ` [PATCH v2 0/3] cgroup/cpuset: Fix some more bugs in cpuset partition code Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c4b63601-ab06-4ee0-8d15-4c4acfa35f81@linux.dev \
--to=guopeng.zhang@linux.dev \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mkoutny@suse.com \
--cc=ridong.chen@linux.dev \
--cc=shuah@kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®