lkml.org 
[lkml]   [2016]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 3/4] cgroup: use spin_lock_irq for cgroup match and attach fns
Date
Since these functions will be called from the worker
thread context, using spin_lock_bh triggers WARN_ONs.

Signed-off-by: Bandan Das <bsd@redhat.com>
---
kernel/cgroup.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 3ffdbb4..24b34e8 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2764,10 +2764,10 @@ bool cgroup_match_groups(struct task_struct *tsk1, struct task_struct *tsk2)
if (!root->subsys_mask)
continue;

- spin_lock_bh(&css_set_lock);
+ spin_lock_irq(&css_set_lock);
cg_tsk1 = task_cgroup_from_root(tsk1, root);
cg_tsk2 = task_cgroup_from_root(tsk2, root);
- spin_unlock_bh(&css_set_lock);
+ spin_unlock_irq(&css_set_lock);

if (cg_tsk1 != cg_tsk2) {
result = false;
@@ -2797,9 +2797,9 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *tsk)
if (root == &cgrp_dfl_root)
continue;

- spin_lock_bh(&css_set_lock);
+ spin_lock_irq(&css_set_lock);
from_cgrp = task_cgroup_from_root(from, root);
- spin_unlock_bh(&css_set_lock);
+ spin_unlock_irq(&css_set_lock);

retval = cgroup_attach_task(from_cgrp, tsk, false);
if (retval)
--
2.5.0
\
 
 \ /
  Last update: 2016-03-19 00:01    [W:0.407 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site