Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753834AbcCRWQQ (ORCPT ); Fri, 18 Mar 2016 18:16:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47281 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753059AbcCRWQN (ORCPT ); Fri, 18 Mar 2016 18:16:13 -0400 From: Bandan Das To: tj@kernel.org Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, mst@redhat.com, jiangshanlai@gmail.com, RAPOPORT@il.ibm.com Subject: [RFC PATCH 3/4] cgroup: use spin_lock_irq for cgroup match and attach fns Date: Fri, 18 Mar 2016 18:14:50 -0400 Message-Id: <1458339291-4093-4-git-send-email-bsd@redhat.com> In-Reply-To: <1458339291-4093-1-git-send-email-bsd@redhat.com> References: <1458339291-4093-1-git-send-email-bsd@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1194 Lines: 39 Since these functions will be called from the worker thread context, using spin_lock_bh triggers WARN_ONs. Signed-off-by: Bandan Das --- 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