Re: [PATCH next] cpuset: Treat tasks in attaching process as populated

From: Waiman Long

Date: Tue Nov 11 2025 - 10:16:39 EST


On 11/11/25 9:01 AM, Michal Koutný wrote:
Hi Ridong.

On Tue, Nov 11, 2025 at 01:26:32PM +0000, Chen Ridong <chenridong@xxxxxxxxxxxxxxx> wrote:
...
+static inline bool cs_is_populated(struct cpuset *cs)
+{
+ /* Tasks in the process of attaching should be considered as populated */
+ return cgroup_is_populated(cs->css.cgroup) ||
+ cs->attach_in_progress;
+}
s/process/cpuset/ in the subject
and
s/Tasks/Cpusets/ in the comment above
Agreed.
Also, should there be some lockdep_assert_held() in this helper (for
documentation purposes but also for correctly synchronized validity of
the returned value.)

A lockdep_assert_held() is certainly needed if it is an externally visible helper that can be called outside cpuset. For internal helper like this one, we may not really need that as almost all the code in cpuset.c are within either a cpuset_mutex or callback_lock critical sections. So I am fine with or without it.

Cheers,
Longman