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

From: Michal Koutný

Date: Tue Nov 11 2025 - 14:25:47 EST


On Tue, Nov 11, 2025 at 10:16:33AM -0500, Waiman Long <llong@xxxxxxxxxx> wrote:
> 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.

OK, cpuset_mutex and callback_lock are close but cgroup_is_populated()
that caught my eye would also need cgroup_mutex otherwise "the result
can only be used as a hint" (quote from cgroup.h).

Or is it safe to assume that cpuset_mutex inside cpuset_attach() is
sufficient to always (incl. exits) ensure stability of
cgroup_is_populated() result?

Anyway, I'd find some clarifications in the commit message or the
surrounding code about this helpful. (Judgment call, whether with a
lockdep macro. My opinion is -- why not.)

Thanks,
Michal

Attachment: signature.asc
Description: PGP signature