All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] memcg-let-css_get_next-rely-upon-rcu_read_lock.patch removed from -mm tree
@ 2012-03-22 20:19 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2012-03-22 20:19 UTC (permalink / raw)
  To: hughd, eric.dumazet, kamezawa.hiroyu, lizf, tj, mm-commits


The patch titled
     Subject: memcg: let css_get_next() rely upon rcu_read_lock()
has been removed from the -mm tree.  Its filename was
     memcg-let-css_get_next-rely-upon-rcu_read_lock.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
From: Hugh Dickins <hughd@google.com>
Subject: memcg: let css_get_next() rely upon rcu_read_lock()

Remove lock and unlock around css_get_next()'s call to idr_get_next(). 
memcg iterators (only users of css_get_next) already did rcu_read_lock(),
and its comment demands that; but add a WARN_ON_ONCE to make sure of it.

Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/cgroup.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff -puN kernel/cgroup.c~memcg-let-css_get_next-rely-upon-rcu_read_lock kernel/cgroup.c
--- a/kernel/cgroup.c~memcg-let-css_get_next-rely-upon-rcu_read_lock
+++ a/kernel/cgroup.c
@@ -5033,6 +5033,8 @@ css_get_next(struct cgroup_subsys *ss, i
 		return NULL;
 
 	BUG_ON(!ss->use_id);
+	WARN_ON_ONCE(!rcu_read_lock_held());
+
 	/* fill start point for scan */
 	tmpid = id;
 	while (1) {
@@ -5040,10 +5042,7 @@ css_get_next(struct cgroup_subsys *ss, i
 		 * scan next entry from bitmap(tree), tmpid is updated after
 		 * idr_get_next().
 		 */
-		spin_lock(&ss->id_lock);
 		tmp = idr_get_next(&ss->idr, &tmpid);
-		spin_unlock(&ss->id_lock);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-22 20:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22 20:19 [merged] memcg-let-css_get_next-rely-upon-rcu_read_lock.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.