summaryrefslogtreecommitdiff
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-05-13 12:10:59 -0400
committerTejun Heo <tj@kernel.org>2014-05-13 12:10:59 -0400
commit54504e977ceee0bea6fbe8b632eceea771b18c6c (patch)
tree61d7e8f9bfc78a7cd92a0860669a5a38dcd06d24 /kernel/cgroup.c
parent0cee8b7786467907e12d1d8f872e6dc73bc95204 (diff)
cgroup: cgroup_idr_lock should be bh
cgroup_idr_remove() can be invoked from bh leading to lockdep detecting possible AA deadlock (IN_BH/ON_BH). Make the lock bh-safe. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 95fc66b16091..e2ff925e6ee8 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -203,9 +203,9 @@ static int cgroup_idr_alloc(struct idr *idr, void *ptr, int start, int end,
int ret;
idr_preload(gfp_mask);
- spin_lock(&cgroup_idr_lock);
+ spin_lock_bh(&cgroup_idr_lock);
ret = idr_alloc(idr, ptr, start, end, gfp_mask);
- spin_unlock(&cgroup_idr_lock);
+ spin_unlock_bh(&cgroup_idr_lock);
idr_preload_end();
return ret;
}
@@ -214,17 +214,17 @@ static void *cgroup_idr_replace(struct idr *idr, void *ptr, int id)
{
void *ret;
- spin_lock(&cgroup_idr_lock);
+ spin_lock_bh(&cgroup_idr_lock);
ret = idr_replace(idr, ptr, id);
- spin_unlock(&cgroup_idr_lock);
+ spin_unlock_bh(&cgroup_idr_lock);
return ret;
}
static void cgroup_idr_remove(struct idr *idr, int id)
{
- spin_lock(&cgroup_idr_lock);
+ spin_lock_bh(&cgroup_idr_lock);
idr_remove(idr, id);
- spin_unlock(&cgroup_idr_lock);
+ spin_unlock_bh(&cgroup_idr_lock);
}
/**