mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guopeng Zhang <guopeng.zhang@linux.dev>
To: Tejun Heo <tj@kernel.org>, Waiman Long <longman@redhat.com>
Cc: "Ridong Chen" <ridong.chen@linux.dev>,
	"Johannes Weiner" <hannes@cmpxchg.org>,
	"Michal Koutný" <mkoutny@suse.com>,
	"Guopeng Zhang" <zhangguopeng@kylinos.cn>,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] cgroup/cpuset: Invalidate remote partition on housekeeping conflict
Date: Tue, 29 Sep 2026 10:33:16 +0800	[thread overview]
Message-ID: <c4dcad59-bca3-406f-b726-74813bbcdfc2@linux.dev> (raw)
In-Reply-To: <7f4c57b26ad120ab30adf35653f1dd94@kernel.org>



在 2026/9/29 02:44, Tejun Heo 写道:
Hi,Tejun

> Hello, Guopeng.
> 
> The following is a Claude-generated review.
> 
> On Sun, Sep 27, 2026 at 05:57:21PM +0800, Guopeng Zhang wrote:
>> +	bool updating = is_remote_partition(cs);
>> +
>> +	if (!capable(CAP_SYS_ADMIN))
>> +		return PERR_ACCESS;
>> +
>> +	if (!updating &&
>> +	    (!cpumask_intersects(excpus, cpu_active_mask) ||
>> +	     cpumask_subset(top_cpuset.effective_cpus, addcpus)))
>> +		return PERR_INVCPUS;
> 
> cs->remote_partition can be stale when remote_partition_enable() is
> called. If a root <-> isolated switch of a valid remote partition fails
> in update_prstate(), the partition is made invalid without
> remote_partition_disable(), so the flag stays set and its CPUs stay in
> subpartitions_cpus. A later enable then skips the PERR_INVCPUS checks.
> With isolcpus=domain,4:
> 
> 1. A is a member with cpuset.cpus 2-6 and cpuset.cpus.exclusive 2-4. B
>    has cpuset.cpus 2-4 and no cpuset.cpus.exclusive.
> 2. "isolated" to B's cpuset.cpus.partition. B becomes a valid remote
>    partition with effective_xcpus 2-4.
> 3. "root" to B's cpuset.cpus.partition fails with PERR_HKEEPING.
>    effective_xcpus is cleared but remote_partition stays set.
> 4. 5-6 to A's cpuset.cpus.exclusive. B's excpus becomes empty, which
>    matches the cleared effective_xcpus, so update_cpumasks_hier() skips
>    B.
> 5. "isolated" to B's cpuset.cpus.partition. This used to fail with
>    PERR_INVCPUS. Now B becomes a valid isolated partition with empty
>    effective_xcpus and the WARN_ON_ONCE() at the end of update_prstate()
>    triggers.
> 
> This is from reading the code, not reproduced. Maybe have the callers
> pass whether it's an enable or an update instead of deriving it from
> cs->remote_partition?

You're right. I'll fix it in v3.

Thanks,
Guopeng
> 
> The stale flag itself is a separate, pre-existing bug. Switching B back
> to member after step 3 trips the WARN_ON_ONCE(old_prs < 0) in
> partition_xcpus_del().
> 
> Thanks.
> 
> --
> tejun


      parent reply	other threads:[~2026-09-29  2:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27  9:57 Guopeng Zhang
2026-09-28  0:00 ` Waiman Long
2026-09-28  1:29 ` Ridong Chen
2026-09-28 18:44 ` Tejun Heo
2026-09-28 23:56   ` Waiman Long
2026-09-29  2:33   ` Guopeng Zhang [this message]

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=c4dcad59-bca3-406f-b726-74813bbcdfc2@linux.dev \
    --to=guopeng.zhang@linux.dev \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mkoutny@suse.com \
    --cc=ridong.chen@linux.dev \
    --cc=tj@kernel.org \
    --cc=zhangguopeng@kylinos.cn \
    /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®