android_kernel_motorola_sm6375/kernel/cgroup
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tejun Heo 59c6902a96 cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock
[ Upstream commit 4f7e7236435ca0abe005c674ebd6892c6e83aeb3 ]

Bringing up a CPU may involve creating and destroying tasks which requires
read-locking threadgroup_rwsem, so threadgroup_rwsem nests inside
cpus_read_lock(). However, cpuset's ->attach(), which may be called with
thredagroup_rwsem write-locked, also wants to disable CPU hotplug and
acquires cpus_read_lock(), leading to a deadlock.

Fix it by guaranteeing that ->attach() is always called with CPU hotplug
disabled and removing cpus_read_lock() call from cpuset_attach().

Signed-off-by: Tejun Heo <[email protected]>
Reviewed-and-tested-by: Imran Khan <[email protected]>
Reported-and-tested-by: Xuewen Yan <[email protected]>
Fixes: 05c7b7a92cc8 ("cgroup/cpuset: Fix a race between cpuset_attach() and cpu hotplug")
Cc: [email protected] # v5.17+
Signed-off-by: Sasha Levin <[email protected]>
2022-09-15 12:04:54 +02:00
..
cgroup-internal.h cgroup: Optimize single thread migration 2022-09-15 12:04:54 +02:00
cgroup-v1.c cgroup: Optimize single thread migration 2022-09-15 12:04:54 +02:00
cgroup.c cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock 2022-09-15 12:04:54 +02:00
cpuset.c cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock 2022-09-15 12:04:54 +02:00
debug.c
freezer.c
legacy_freezer.c
Makefile
namespace.c
pids.c
rdma.c
rstat.c Revert "cgroup: Add memory barriers to plug cgroup_rstat_updated() race window" 2020-06-07 13:18:46 +02:00