linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] radix-tree: document wrap-around issue of radix_tree_next_hole()
@ 2008-11-23 10:51 Wu Fengguang
  2008-11-27 10:38 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Wu Fengguang @ 2008-11-23 10:51 UTC (permalink / raw)
  To: Trivial Patch Monkey; +Cc: Nick Piggin, linux-mm

And some 80-line cleanups.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
---
 lib/radix-tree.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

--- linux-2.6.orig/lib/radix-tree.c
+++ linux-2.6/lib/radix-tree.c
@@ -640,13 +640,14 @@ EXPORT_SYMBOL(radix_tree_tag_get);
  *
  *	Returns: the index of the hole if found, otherwise returns an index
  *	outside of the set specified (in which case 'return - index >= max_scan'
- *	will be true).
+ *	will be true). In rare cases of index wrap-around, 0 will be returned.
  *
  *	radix_tree_next_hole may be called under rcu_read_lock. However, like
- *	radix_tree_gang_lookup, this will not atomically search a snapshot of the
- *	tree at a single point in time. For example, if a hole is created at index
- *	5, then subsequently a hole is created at index 10, radix_tree_next_hole
- *	covering both indexes may return 10 if called under rcu_read_lock.
+ *	radix_tree_gang_lookup, this will not atomically search a snapshot of
+ *	the tree at a single point in time. For example, if a hole is created
+ *	at index 5, then subsequently a hole is created at index 10,
+ *	radix_tree_next_hole covering both indexes may return 10 if called
+ *	under rcu_read_lock.
  */
 unsigned long radix_tree_next_hole(struct radix_tree_root *root,
 				unsigned long index, unsigned long max_scan)

--
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] radix-tree: document wrap-around issue of radix_tree_next_hole()
  2008-11-23 10:51 [PATCH] radix-tree: document wrap-around issue of radix_tree_next_hole() Wu Fengguang
@ 2008-11-27 10:38 ` Jiri Kosina
  2008-11-27 11:39   ` Wu Fengguang
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2008-11-27 10:38 UTC (permalink / raw)
  To: Wu Fengguang; +Cc: Trivial Patch Monkey, Nick Piggin, linux-mm

On Sun, 23 Nov 2008, Wu Fengguang wrote:

> And some 80-line cleanups.
> 
> Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
> ---
>  lib/radix-tree.c |   11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> --- linux-2.6.orig/lib/radix-tree.c
> +++ linux-2.6/lib/radix-tree.c
> @@ -640,13 +640,14 @@ EXPORT_SYMBOL(radix_tree_tag_get);
>   *
>   *	Returns: the index of the hole if found, otherwise returns an index
>   *	outside of the set specified (in which case 'return - index >= max_scan'
> - *	will be true).
> + *	will be true). In rare cases of index wrap-around, 0 will be returned.
>   *
>   *	radix_tree_next_hole may be called under rcu_read_lock. However, like
> - *	radix_tree_gang_lookup, this will not atomically search a snapshot of the
> - *	tree at a single point in time. For example, if a hole is created at index
> - *	5, then subsequently a hole is created at index 10, radix_tree_next_hole
> - *	covering both indexes may return 10 if called under rcu_read_lock.
> + *	radix_tree_gang_lookup, this will not atomically search a snapshot of
> + *	the tree at a single point in time. For example, if a hole is created
> + *	at index 5, then subsequently a hole is created at index 10,
> + *	radix_tree_next_hole covering both indexes may return 10 if called
> + *	under rcu_read_lock.
>   */
>  unsigned long radix_tree_next_hole(struct radix_tree_root *root,
>  				unsigned long index, unsigned long max_scan)
> 

I don't see this applied in any of the publically visible trees, so I have 
taken this into -trivial. Please let me know if it has been through any 
other channel already.

Thanks,

-- 
Jiri Kosina
SUSE Labs

--
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] radix-tree: document wrap-around issue of radix_tree_next_hole()
  2008-11-27 10:38 ` Jiri Kosina
@ 2008-11-27 11:39   ` Wu Fengguang
  0 siblings, 0 replies; 3+ messages in thread
From: Wu Fengguang @ 2008-11-27 11:39 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Trivial Patch Monkey, Nick Piggin, linux-mm

On Thu, Nov 27, 2008 at 12:38:06PM +0200, Jiri Kosina wrote:
> On Sun, 23 Nov 2008, Wu Fengguang wrote:
> 
> > And some 80-line cleanups.
> > 
> > Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
> > ---
> >  lib/radix-tree.c |   11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> > 
> > --- linux-2.6.orig/lib/radix-tree.c
> > +++ linux-2.6/lib/radix-tree.c
> > @@ -640,13 +640,14 @@ EXPORT_SYMBOL(radix_tree_tag_get);
> >   *
> >   *	Returns: the index of the hole if found, otherwise returns an index
> >   *	outside of the set specified (in which case 'return - index >= max_scan'
> > - *	will be true).
> > + *	will be true). In rare cases of index wrap-around, 0 will be returned.
> >   *
> >   *	radix_tree_next_hole may be called under rcu_read_lock. However, like
> > - *	radix_tree_gang_lookup, this will not atomically search a snapshot of the
> > - *	tree at a single point in time. For example, if a hole is created at index
> > - *	5, then subsequently a hole is created at index 10, radix_tree_next_hole
> > - *	covering both indexes may return 10 if called under rcu_read_lock.
> > + *	radix_tree_gang_lookup, this will not atomically search a snapshot of
> > + *	the tree at a single point in time. For example, if a hole is created
> > + *	at index 5, then subsequently a hole is created at index 10,
> > + *	radix_tree_next_hole covering both indexes may return 10 if called
> > + *	under rcu_read_lock.
> >   */
> >  unsigned long radix_tree_next_hole(struct radix_tree_root *root,
> >  				unsigned long index, unsigned long max_scan)
> > 
> 
> I don't see this applied in any of the publically visible trees, so I have 
> taken this into -trivial. Please let me know if it has been through any 
> other channel already.

OK, thank you.

Fengguang

--
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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-27 11:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-23 10:51 [PATCH] radix-tree: document wrap-around issue of radix_tree_next_hole() Wu Fengguang
2008-11-27 10:38 ` Jiri Kosina
2008-11-27 11:39   ` Wu Fengguang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox