From: Waiman Long <longman@redhat.com>
To: "Michal Koutný" <mkoutny@suse.com>, "Tao Cui" <cui.tao@linux.dev>
Cc: chenridong@huaweicloud.com, tj@kernel.org, hannes@cmpxchg.org,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
Tao Cui <cuitao@kylinos.cn>
Subject: Re: [PATCH v2] cgroup/cpuset: Fix update_prstate() always returning 0 on partition errors
Date: Tue, 2 Jun 2026 14:41:06 -0400 [thread overview]
Message-ID: <9fad648e-4b46-4326-ae92-9a46302990cc@redhat.com> (raw)
In-Reply-To: <ah6JpNvdO7vaBmjS@localhost.localdomain>
On 6/2/26 3:46 AM, Michal Koutný wrote:
> Hi.
>
> On Tue, Jun 02, 2026 at 12:55:21PM +0800, Tao Cui <cui.tao@linux.dev> wrote:
>> update_prstate() stores the error code in cs->prs_err and transitions
>> the partition to an invalid state, but always returns 0. The caller
>> cpuset_partition_write() uses "return retval ?: nbytes", so the write
>> syscall always appears to succeed from userspace even when the partition
>> became invalid.
>> Return -EINVAL when err is set so userspace can detect
>> the failure immediately.
> This is quite a visible UAPI change (a write can succeed to invalidate a
> partition) and users are meant to watch for cpuset.cpus.partition state
> anyway for asynchronous changes.
Right, it is purposely done to not return a write error when writing any
cpuset control files. The only exception is cpuset.cpus.exclusive which
can return failure when an exclusive CPU has been taken. It is
documented in cgroup-v2.rst.
Cheers,
Longman
prev parent reply other threads:[~2026-06-02 18:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 4:55 Tao Cui
2026-06-02 7:46 ` Michal Koutný
2026-06-02 8:19 ` Tao Cui
2026-06-02 18:41 ` Waiman Long [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=9fad648e-4b46-4326-ae92-9a46302990cc@redhat.com \
--to=longman@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=chenridong@huaweicloud.com \
--cc=cui.tao@linux.dev \
--cc=cuitao@kylinos.cn \
--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
all inboxes | Powered by JetHome®