summaryrefslogtreecommitdiff
path: root/kernel/cgroup/pids.c
diff options
context:
space:
mode:
authorWaiman Long <longman@redhat.com>2023-04-11 09:35:58 -0400
committerTejun Heo <tj@kernel.org>2023-04-12 08:23:58 -1000
commit42a11bf5c5436e91b040aeb04063be1710bb9f9c (patch)
treeff02e5249b0b5f2e8f16c820c57c0339fd2e5217 /kernel/cgroup/pids.c
parentba9182a89626d5f83c2ee4594f55cb9c1e60f0e2 (diff)
cgroup/cpuset: Make cpuset_fork() handle CLONE_INTO_CGROUP properly
By default, the clone(2) syscall spawn a child process into the same cgroup as its parent. With the use of the CLONE_INTO_CGROUP flag introduced by commit ef2c41cf38a7 ("clone3: allow spawning processes into cgroups"), the child will be spawned into a different cgroup which is somewhat similar to writing the child's tid into "cgroup.threads". The current cpuset_fork() method does not properly handle the CLONE_INTO_CGROUP case where the cpuset of the child may be different from that of its parent. Update the cpuset_fork() method to treat the CLONE_INTO_CGROUP case similar to cpuset_attach(). Since the newly cloned task has not been running yet, its actual memory usage isn't known. So it is not necessary to make change to mm in cpuset_fork(). Fixes: ef2c41cf38a7 ("clone3: allow spawning processes into cgroups") Reported-by: Giuseppe Scrivano <gscrivan@redhat.com> Signed-off-by: Waiman Long <longman@redhat.com> Cc: stable@vger.kernel.org # v5.7+ Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup/pids.c')
0 files changed, 0 insertions, 0 deletions