From: Waiman Long <llong@redhat.com>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
linux-kernel@vger.kernel.org, cgroups@vger.kernel.org,
Chen Ridong <chenridong@huaweicloud.com>,
Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH v3] sched/core: Skip user_cpus_ptr masking if no online CPU left
Date: Mon, 21 Jul 2025 11:28:15 -0400 [thread overview]
Message-ID: <9bd275be-45df-47f3-9be3-f7e1458815a4@redhat.com> (raw)
In-Reply-To: <2vpxlzo6kruo23ljelerqkofybovtrxalinbz56wgpek6j47et@om6jyuyqecog>
On 7/21/25 11:13 AM, Michal Koutný wrote:
> On Fri, Jul 18, 2025 at 12:48:56PM -0400, Waiman Long <longman@redhat.com> wrote:
>> Chen Ridong reported that cpuset could report a kernel warning for a task
>> due to set_cpus_allowed_ptr() returning failure in the corner case that:
>>
>> 1) the task used sched_setaffinity(2) to set its CPU affinity mask to
>> be the same as the cpuset.cpus of its cpuset,
>> 2) all the CPUs assigned to that cpuset were taken offline, and
>> 3) cpuset v1 is in use and the task had to be migrated to the top cpuset.
> Does this make sense for cpuset v2 (or no cpuset at all for that matter)?
> I'm asking whether this mask modification could only be extracted into
> cpuset-v1.c (like cgroup_tranfer_tasks() or a new function)
This corner case as specified in Chen Ridong's patch only happens with a
cpuset v1 environment, but it is still the case that the default cpu
affinity of the root cgroup (with or without CONFIG_CGROUPS) will
include offline CPUs, if present. So it still make senses to skip the
sched_setaffinity() setting if there is no online CPU left, though it
will be much harder to have such a condition without using cpuset v1.
Cheers,
Longman
next prev parent reply other threads:[~2025-07-21 15:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-18 16:41 [PATCH v2] sched/core: Mask out offline CPUs when user_cpus_ptr is used Waiman Long
2025-07-18 16:44 ` Waiman Long
2025-07-18 16:48 ` [PATCH v3] sched/core: Skip user_cpus_ptr masking if no online CPU left Waiman Long
2025-07-21 15:13 ` Michal Koutný
2025-07-21 15:28 ` Waiman Long [this message]
2025-08-26 14:25 ` Michal Koutný
2025-08-26 16:06 ` Waiman Long
2025-07-23 1:58 ` Chen Ridong
2025-07-31 12:03 ` Chen Ridong
2025-08-14 1:14 ` Chen Ridong
2025-10-29 21:27 ` [RESEND PATCH " Waiman Long
2025-10-30 10:56 ` Michal Koutný
2025-10-31 0:53 ` Chen Ridong
2026-01-12 3:36 ` Chen Ridong
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=9bd275be-45df-47f3-9be3-f7e1458815a4@redhat.com \
--to=llong@redhat.com \
--cc=bsegall@google.com \
--cc=cgroups@vger.kernel.org \
--cc=chenridong@huaweicloud.com \
--cc=dietmar.eggemann@arm.com \
--cc=hannes@cmpxchg.org \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=mkoutny@suse.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/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®