From patchwork Mon Nov 1 19:15:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Olsa X-Patchwork-Id: 295522 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA1JHg72011043 for ; Mon, 1 Nov 2010 19:17:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751264Ab0KATQc (ORCPT ); Mon, 1 Nov 2010 15:16:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60142 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750943Ab0KATQb (ORCPT ); Mon, 1 Nov 2010 15:16:31 -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 (8.13.8/8.13.8) with ESMTP id oA1JFFKu009248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 1 Nov 2010 15:15:15 -0400 Received: from jolsa.brq.redhat.com (dhcp-1-174.brq.redhat.com [10.34.1.174]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oA1JF9IK025578; Mon, 1 Nov 2010 15:15:12 -0400 From: Jiri Olsa To: dhowells@redhat.com, lizf@cn.fujitsu.com, paul.moore@hp.com, johannes@sipsolutions.net, dipankar@in.ibm.com Cc: linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org, kvm@vger.kernel.org, Jiri Olsa Subject: [PATCH 1/3] cgroup - removing superfluous rcu_read_lock_held check Date: Mon, 1 Nov 2010 20:15:07 +0100 Message-Id: <1288638909-10541-2-git-send-email-jolsa@redhat.com> In-Reply-To: <1288638909-10541-1-git-send-email-jolsa@redhat.com> References: <1288638909-10541-1-git-send-email-jolsa@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-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 01 Nov 2010 19:17:42 +0000 (UTC) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ed4ba11..caed568 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -536,7 +536,6 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state( */ #define task_subsys_state_check(task, subsys_id, __c) \ rcu_dereference_check(task->cgroups->subsys[subsys_id], \ - rcu_read_lock_held() || \ lockdep_is_held(&task->alloc_lock) || \ cgroup_lock_is_held() || (__c)) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 66a416b..1f329a2 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -1687,7 +1687,6 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen) { char *start; struct dentry *dentry = rcu_dereference_check(cgrp->dentry, - rcu_read_lock_held() || cgroup_lock_is_held()); if (!dentry || cgrp == dummytop) { @@ -1713,7 +1712,6 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen) break; dentry = rcu_dereference_check(cgrp->dentry, - rcu_read_lock_held() || cgroup_lock_is_held()); if (!cgrp->parent) continue; @@ -4544,7 +4542,7 @@ unsigned short css_id(struct cgroup_subsys_state *css) * it's unchanged until freed. */ cssid = rcu_dereference_check(css->id, - rcu_read_lock_held() || atomic_read(&css->refcnt)); + atomic_read(&css->refcnt)); if (cssid) return cssid->id; @@ -4557,7 +4555,7 @@ unsigned short css_depth(struct cgroup_subsys_state *css) struct css_id *cssid; cssid = rcu_dereference_check(css->id, - rcu_read_lock_held() || atomic_read(&css->refcnt)); + atomic_read(&css->refcnt)); if (cssid) return cssid->depth;