From patchwork Fri Mar 18 22:14:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bandan Das X-Patchwork-Id: 8624051 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 714029F44D for ; Fri, 18 Mar 2016 22:17:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4F752038F for ; Fri, 18 Mar 2016 22:16:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BCA7520389 for ; Fri, 18 Mar 2016 22:16:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753589AbcCRWQP (ORCPT ); Fri, 18 Mar 2016 18:16:15 -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 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 6BF31C00DE04; Fri, 18 Mar 2016 22:16:12 +0000 (UTC) Received: from aqua.redhat.com (ovpn-113-23.phx2.redhat.com [10.3.113.23]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2IMFljq026718; Fri, 18 Mar 2016 18:16:11 -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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)