From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Nick Piggin <piggin@cyberone.com.au>
Cc: linux-mm <linux-mm@kvack.org>,
Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Subject: radix_tree_lookup_slot() comment
Date: Sat, 23 Sep 2006 20:40:21 +0200 [thread overview]
Message-ID: <1159036821.5196.8.camel@lappy> (raw)
Hi Nick,
I noticed the comment above radix_tree_lookup_slot() did not match the
uses in your lockless pagecache. Would this patch be correct?
---
lib/radix-tree.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
Index: linux-2.6-mm/lib/radix-tree.c
===================================================================
--- linux-2.6-mm.orig/lib/radix-tree.c 2006-09-23 20:20:21.000000000 +0200
+++ linux-2.6-mm/lib/radix-tree.c 2006-09-23 20:34:31.000000000 +0200
@@ -380,11 +380,10 @@ EXPORT_SYMBOL(radix_tree_insert);
* Returns: the slot corresponding to the position @index in the
* radix tree @root. This is useful for update-if-exists operations.
*
- * This function cannot be called under rcu_read_lock, it must be
- * excluded from writers, as must the returned slot for subsequent
- * use by radix_tree_deref_slot() and radix_tree_replace slot.
- * Caller must hold tree write locked across slot lookup and
- * replace.
+ * This function can be called under rcu_read_lock iff the slot is not
+ * modified by radix_tree_replace_slot, otherwise it must be called
+ * exclusive from other writers. Any dereference of the slot must be done
+ * using radix_tree_deref_slot.
*/
void **radix_tree_lookup_slot(struct radix_tree_root *root, unsigned long index)
{
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2006-09-23 18:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-23 18:40 Peter Zijlstra [this message]
2006-09-24 14:40 ` Nick Piggin
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=1159036821.5196.8.camel@lappy \
--to=a.p.zijlstra@chello.nl \
--cc=Lee.Schermerhorn@hp.com \
--cc=linux-mm@kvack.org \
--cc=piggin@cyberone.com.au \
/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