From: Andrew Morton <akpm@linux-foundation.org>
To: Hugh Dickins <hughd@google.com>
Cc: Tejun Heo <tj@kernel.org>, Eric Dumazet <eric.dumazet@gmail.com>,
Li Zefan <lizf@cn.fujitsu.com>,
Manfred Spraul <manfred@colorfullife.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Ying Han <yinghan@google.com>, Greg Thelen <gthelen@google.com>,
cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] idr: make idr_get_next() good for rcu_read_lock()
Date: Fri, 20 Jan 2012 15:48:07 -0800 [thread overview]
Message-ID: <20120120154807.c55c9ac7.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LSU.2.00.1201191247210.29542@eggly.anvils>
On Thu, 19 Jan 2012 12:48:48 -0800 (PST)
Hugh Dickins <hughd@google.com> wrote:
> Make one small adjustment to idr_get_next(): take the height from the
> top layer (stable under RCU) instead of from the root (unprotected by
> RCU), as idr_find() does: so that it can be used with RCU locking.
> Copied comment on RCU locking from idr_find().
>
> 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>
> ---
> lib/idr.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> --- 3.2.0+.orig/lib/idr.c 2012-01-04 15:55:44.000000000 -0800
> +++ 3.2.0+/lib/idr.c 2012-01-19 11:55:28.780206713 -0800
> @@ -595,8 +595,10 @@ EXPORT_SYMBOL(idr_for_each);
> * Returns pointer to registered object with id, which is next number to
> * given id. After being looked up, *@nextidp will be updated for the next
> * iteration.
> + *
> + * This function can be called under rcu_read_lock(), given that the leaf
> + * pointers lifetimes are correctly managed.
Awkward comment. It translates to "..., because the leaf pointers
lifetimes are correctly managed".
Is that what we really meant? Or did we mean "..., provided the leaf
pointers lifetimes are correctly managed"?
Also, "pointers" should have been "pointer" or "pointer's"!
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-01-20 23:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-19 6:05 [PATCH] memcg: restore ss->id_lock to spinlock, using RCU for next Hugh Dickins
2012-01-19 6:58 ` KAMEZAWA Hiroyuki
2012-01-19 7:31 ` Li Zefan
2012-01-19 7:33 ` Eric Dumazet
2012-01-19 12:28 ` Tejun Heo
2012-01-19 13:30 ` Eric Dumazet
2012-01-19 20:46 ` Hugh Dickins
2012-01-19 20:48 ` [PATCH 1/3] idr: make idr_get_next() good for rcu_read_lock() Hugh Dickins
2012-01-20 23:48 ` Andrew Morton [this message]
2012-01-21 3:45 ` Hugh Dickins
2012-01-21 20:43 ` Randy Dunlap
2012-01-19 20:50 ` [PATCH 2/3] cgroup: revert ss_id_lock to spinlock Hugh Dickins
2012-01-19 20:51 ` [PATCH 3/3] memcg: let css_get_next() rely upon rcu_read_lock() Hugh Dickins
2012-01-19 20:53 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120120154807.c55c9ac7.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=eric.dumazet@gmail.com \
--cc=gthelen@google.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=manfred@colorfullife.com \
--cc=tj@kernel.org \
--cc=yinghan@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).