Re: [PATCH 3/3] cgroup/cpuset: Allow only one active attach operation per cpuset

From: Waiman Long
Date: Tue Apr 04 2023 - 10:14:41 EST



On 4/4/23 05:07, Michal Koutný wrote:
Hi.

On Mon, Apr 03, 2023 at 01:41:33PM -0400, Waiman Long <longman@xxxxxxxxxx> wrote:
This patch is actually not related to the CLONE_INTO_GROUP problem in patch
1. It is a generic problem when multiple users are moving threads into
cgroup.threads of the same or different cpusets simultaneously.
I meant this:
__cgroup_procs_write
cgroup_kn_lock_live
mutex_lock(&cgroup_mutex)

and (more succintly)
cgroup_update_dfl_csses
lockdep_assert_held(&cgroup_mutex)

Even the threaded migrations should be synchronized here.
Can you please explain in more detail what's the problematic case?

You are right. I missed the cgroup_mutex synchronization here. So this patch isn't needed. I will drop it in the next version.

Cheers,
Longman