From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Cc: Andrew Morton <akpm@osdl.org>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Christoph Lameter <clameter@sgi.com>,
linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH] radix-tree: fix radix_tree_replace_slot
Date: Wed, 23 Aug 2006 22:05:16 -0700 [thread overview]
Message-ID: <20060824050516.GC18961@us.ibm.com> (raw)
In-Reply-To: <1156278317.5622.14.camel@localhost>
On Tue, Aug 22, 2006 at 04:25:17PM -0400, Lee Schermerhorn wrote:
> Andrew:
>
> I was waiting to hear from Nick on this, but I understand that he has
> severely injured one hand, restricting his keyboard access for a while.
>
> Christoph has been too swamped to take a look, either. So, having
> tested it myself, I'll send it on.
>
> Paul:
>
> could you take a look at this one. Also, I'll be sending another
> rcu-radix-tree "cleanup" patch that I'd like your opinion on.
Color me blind -- I certainly missed this one earlier.
Yes, the original is certainly not very functional...
Thanx, Paul
> Lee
>
> Fix radix tree direct slot replacement - 2.6.18-rc4-mm2
>
> radix_tree_replace_slot() was assigning to local variable 'slot'
> instead of to where pslot pointed. Changed to directly replace
> location pointed to by argument pslot.
>
> Added comments specifying required locking.
>
> Note that we do not need to rcu_dereference() the slot to
> obtain the direct pointer flag, as we hold the tree write locked.
>
> Fixes the migration corruption that we were seeing since the
> rcu-radix-tree patches went in. With this patch, we can back out
> page-migration-replace-radix_tree_lookup_slot-with-radix_tree_lockup.patch
> to use the more efficient direct access to radix tree slot.
>
> Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
>
> include/linux/radix-tree.h | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletion(-)
>
> Index: linux-2.6.18-rc4-mm2/include/linux/radix-tree.h
> ===================================================================
> --- linux-2.6.18-rc4-mm2.orig/include/linux/radix-tree.h 2006-08-22 14:30:38.000000000 -0400
> +++ linux-2.6.18-rc4-mm2/include/linux/radix-tree.h 2006-08-22 14:36:54.000000000 -0400
> @@ -133,12 +133,15 @@ static inline void *radix_tree_deref_slo
> * radix_tree_replace_slot - replace item in a slot
> * @pslot: pointer to slot, returned by radix_tree_lookup_slot
> * @item: new item to store in the slot.
> + *
> + * For use with radix_tree_lookup_slot(). Caller must hold tree write locked
> + * across slot lookup and replacement.
> */
> static inline void radix_tree_replace_slot(void *pslot, void *item)
> {
> void *slot = *(void **)pslot;
> BUG_ON(radix_tree_is_direct_ptr(item));
> - rcu_assign_pointer(slot,
> + rcu_assign_pointer(*(void **)pslot,
> (void *)((unsigned long)item |
> ((unsigned long)slot & RADIX_TREE_DIRECT_PTR)));
> }
>
>
--
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>
prev parent reply other threads:[~2006-08-24 5:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-22 20:25 Lee Schermerhorn
2006-08-22 21:06 ` Christoph Lameter
2006-08-22 21:24 ` Lee Schermerhorn
2006-08-24 2:36 ` Nick Piggin
2006-08-24 5:05 ` Paul E. McKenney [this message]
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=20060824050516.GC18961@us.ibm.com \
--to=paulmck@us.ibm.com \
--cc=Lee.Schermerhorn@hp.com \
--cc=akpm@osdl.org \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.org \
--cc=nickpiggin@yahoo.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