From: Waiman Long <longman@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: "Chen Ridong" <chenridong@huaweicloud.com>,
"Chen Ridong" <chenridong@huawei.com>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] cgroup/cpuset: Skip security check for hotplug induced v1 task migration
Date: Mon, 30 Mar 2026 23:15:14 -0400 [thread overview]
Message-ID: <fbd04c5f-ee9c-4826-ac05-d815ede059b9@redhat.com> (raw)
In-Reply-To: <acq_ELmOia9K8dw4@slm.duckdns.org>
On 3/30/26 2:21 PM, Tejun Heo wrote:
> Hello,
>
> On Mon, Mar 30, 2026 at 12:15:01PM -0400, Waiman Long wrote:
> ...
>>> If there are many tasks in the cpuset that has no CPUs, they will be migrated
>>> one by one. I'm afraid that only the first task will succeed, and the rest will
>>> fail because the flag is cleared after processing the first one.
>> The setsched_check flag is used in the cgroup_taskset_for_each() loop below.
>> That loop is going to iterate all the tasks to be migrated and so the flag
>> will apply to all of them. So it is not just the first one.
> During migration, a taskset is used to group tasks in a thread group if
> cgroup_migrate() called with %true @threadgroup. That doens't really apply
> here. cgroup_transfer_tasks() doesn't set @threadgroup and even if it were
> to set set, there can just be multiple procesess. Besides, it's rather odd
> for it be a one-shot param that gets cleared deep in the stack. Wouldn't it
> make more sense to make whoever sets it to be responsible for clearing it?
Apparently, I have misunderstood how cgroup_transfer_tasks() works.
Right, it calls cgroup_migrate_execute() on a process-by-process basis.
So I shouldn't clear the flag in the first call. As for clearing the
flag, I think we can do it in the CPU hot-add situation or when the
cpuset.cpus is modified.
Thanks,
Longman
next prev parent reply other threads:[~2026-03-31 3:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-29 17:39 [PATCH v2 0/3] cgroup/cpuset: Fix v1 task migration failure from empty cpuset Waiman Long
2026-03-29 17:39 ` [PATCH v2 1/3] cgroup/cpuset: Simplify setsched decision check in task iteration loop of cpuset_can_attach() Waiman Long
2026-03-29 17:39 ` [PATCH v2 2/3] cgroup/cpuset: Skip security check for hotplug induced v1 task migration Waiman Long
2026-03-30 1:48 ` Chen Ridong
2026-03-30 16:15 ` Waiman Long
2026-03-30 18:21 ` Tejun Heo
2026-03-31 3:15 ` Waiman Long [this message]
2026-03-29 17:39 ` [PATCH v2 3/3] cgroup/cpuset: Improve check for v1 task migration out of empty cpuset Waiman Long
2026-03-30 18:25 ` Tejun Heo
2026-03-31 1:05 ` Waiman Long
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=fbd04c5f-ee9c-4826-ac05-d815ede059b9@redhat.com \
--to=longman@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=chenridong@huawei.com \
--cc=chenridong@huaweicloud.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkoutny@suse.com \
--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