From: Waiman Long <llong@redhat.com>
To: "Michal Koutný" <mkoutny@suse.com>,
"Chen Ridong" <chenridong@huaweicloud.com>
Cc: tj@kernel.org, hannes@cmpxchg.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, lujialin4@huawei.com
Subject: Re: [PATCH -next] cpuset: add cpuset1_online_css helper for v1-specific operations
Date: Tue, 16 Dec 2025 09:58:02 -0500 [thread overview]
Message-ID: <5a35692f-2800-4fd4-9c23-97d0284293df@redhat.com> (raw)
In-Reply-To: <vprpzrc6g4ad4m2pwj6j5xp3do7pd7djivhgeoutp6z2qmeq22@ttgkqpew7uo4>
On 12/16/25 9:03 AM, Michal Koutný wrote:
> On Tue, Dec 16, 2025 at 08:13:53PM +0800, Chen Ridong <chenridong@huaweicloud.com> wrote:
>> Regarding the lock assertions: cpuset_mutex is defined in cpuset.c and is not visible in
>> cpuset-v1.c. Given that cpuset v1 is deprecated, would you prefer that we add a helper to assert
>> cpuset_mutex is locked? Is that worth?
> It could be un-static'd and defined in cpuset-internal.h. (Hopefully, we
> should not end up with random callers of the helper but it's IMO worth
> it for docs and greater safety.)
I would suggest defining a "assert_cpuset_lock_held(void)" helper
function and put the declaration in include/linux/cpuset.h together with
cpuset_lock/unlock() to complete the full set. This will allow other
kernel subsystems to acquire the cpuset_mutex and assert that the mutex
was held.
>
>> Should we guard with !cpuset_v2() or !is_in_v2mode()?
>>
>> In cgroup v1, if the cpuset is operating in v2 mode, are these flags still valid?
> I have no experience with this transitional option so that made me look
> at the docs and there we specify it only affects behaviors of CPU masks,
> not the extra flags. So I wanted to suggest !cpuset_v2(), correct?
The "cpuset_v2_mode" mount flag is used for making the behavior of
cpuset.{cpus,mems}.effective in v1 behave like in v2. It has no effect
on other v1 specific control files. So cpuset1_online_css() should only
be called if "!cpuset_v2()".
Cheers,
Longman
>
> Thanks,
> Michal
next prev parent reply other threads:[~2025-12-16 14:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-16 1:28 Chen Ridong
2025-12-16 9:51 ` Michal Koutný
2025-12-16 12:13 ` Chen Ridong
2025-12-16 14:03 ` Michal Koutný
2025-12-16 14:58 ` Waiman Long [this message]
2025-12-17 0:53 ` Chen Ridong
2025-12-17 2:03 ` Waiman Long
2025-12-17 2:18 ` 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=5a35692f-2800-4fd4-9c23-97d0284293df@redhat.com \
--to=llong@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=chenridong@huaweicloud.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lujialin4@huawei.com \
--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®