lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <032b60c1-4a5d-44e1-be9c-05f84172a8ca@redhat.com>
Date: Tue, 16 Dec 2025 21:03:30 -0500
From: Waiman Long <llong@...hat.com>
To: Chen Ridong <chenridong@...weicloud.com>, Waiman Long <llong@...hat.com>,
 Michal Koutný <mkoutny@...e.com>
Cc: tj@...nel.org, hannes@...xchg.org, cgroups@...r.kernel.org,
 linux-kernel@...r.kernel.org, lujialin4@...wei.com
Subject: Re: [PATCH -next] cpuset: add cpuset1_online_css helper for
 v1-specific operations


On 12/16/25 7:53 PM, Chen Ridong wrote:
>
> On 2025/12/16 22:58, Waiman Long wrote:
>> On 12/16/25 9:03 AM, Michal Koutný wrote:
>>> On Tue, Dec 16, 2025 at 08:13:53PM +0800, Chen Ridong <chenridong@...weicloud.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.
> Considering potential use by other subsystems, this is worthwhile. I will add the helper.
>
>>>> 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()".
>>
> If cpuset1_online_css() is only called under the condition !cpuset_v2(), a compile-time option might
> suffice? When CONFIG_CPUSETS_V1=n, cpuset1_online_css could be defined as an empty inline function.

cpuset_v2() includes "!IS_ENABLED(CONFIG_CPUSETS_V1)", so the compiler 
should compile out the call to cpuset1_online_css() if CONFIG_CPUSETS_V1 
isn't defined. If you want to make cpuset1_online_css() conditional on 
CONFIG_CPUSETS_V1, I am fine with that too.

Cheers,
Longman


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ