Commit 404067a2 authored by Lu Jialin's avatar Lu Jialin Committed by yanhaitao
Browse files

cgroup_writeback: fix deadlock in cgroup1_writeback

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8Y0RW



--------------------------------

When read/write memory.wb_blkio_ino of a memcg, and delete the
memcg at the same time, it could cause deadlock as below:
CPU0                               CPU1
rlock(kn->active#4);
				  lock(cgroup_mutex);
				  lock(kn->active#4);
lock(cgroup_mutex);

Therefore, delete locking cgroup_mutex in reading/writing
memory.wb_blkio_ino, just use refcnt and rcu to make sure that
the blkcg exists.

Fixes: 13b8199f0a47 ("cgroup: support cgroup writeback on cgroupv1")
Signed-off-by: default avatarLu Jialin <lujialin4@huawei.com>
Signed-off-by: default avatarChen Ridong <chenridong@huawei.com>
parent 7abc3c4e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment