Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755393Ab0DWCeW (ORCPT ); Thu, 22 Apr 2010 22:34:22 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:58653 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1755150Ab0DWCeV (ORCPT ); Thu, 22 Apr 2010 22:34:21 -0400 Message-ID: <4BD10788.8060006@cn.fujitsu.com> Date: Fri, 23 Apr 2010 10:35:52 +0800 From: Li Zefan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: "Paul E. McKenney" CC: Peter Zijlstra , Lai JIangshan , Paul Menage , Matt Helsley , Cedric Le Goater , LKML , "containers@lists.osdl.org" , Andrew Morton Subject: [PATCH] cgroup: Check task_lock in task_subsys_state() Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1159 Lines: 35 task_subsys_state() is safe under task_lock(). See Documentation/cgroups/cgroups.txt for locking rule. This fixes an RCU warning when resume from suspend. The warning comes from freezer cgroup in cgroup_freezing_or_frozen(). Signed-off-by: Li Zefan --- I'm not sure which is preferable - access ->alloc_lock directly like this patch or add task_lock_is_held() in sched.h --- include/linux/cgroup.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index b8ad1ea..8f78073 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -530,6 +530,7 @@ static inline struct cgroup_subsys_state *task_subsys_state( { return rcu_dereference_check(task->cgroups->subsys[subsys_id], rcu_read_lock_held() || + lockdep_is_held(&task->alloc_lock) || cgroup_lock_is_held()); } -- 1.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/