Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-27 Thread Michel Lespinasse
On Fri, Jul 27, 2012 at 5:44 PM, Michel Lespinasse wrote: > On Fri, Jul 27, 2012 at 1:02 PM, Peter Zijlstra wrote: >> As it stands rb_erase() isn't inlined and its rather big, >> why would you want to inline it for augmented callers? > > Just as the non-augmented rb_erase() is generated (as a

Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-27 Thread Michel Lespinasse
On Fri, Jul 27, 2012 at 1:02 PM, Peter Zijlstra wrote: >On Fri, 2012-07-20 at 05:31 -0700, Michel Lespinasse wrote: >> --- a/lib/rbtree_test.c >> +++ b/lib/rbtree_test.c >> @@ -1,5 +1,6 @@ >> #include >> #include >> +#include >This confuses me.. either its internal to the rb-tree

Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-27 Thread Peter Zijlstra
On Fri, 2012-07-20 at 05:31 -0700, Michel Lespinasse wrote: > +static inline void > +rb_erase_augmented(struct rb_node *node, struct rb_root *root, > + rb_augment_propagate *augment_propagate, > + rb_augment_rotate *augment_rotate) So why put all this in a

Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-27 Thread Peter Zijlstra
On Fri, 2012-07-20 at 05:31 -0700, Michel Lespinasse wrote: > --- a/lib/rbtree_test.c > +++ b/lib/rbtree_test.c > @@ -1,5 +1,6 @@ > #include > #include > +#include This confuses me.. either its internal to the rb-tree implementation and users don't need to see it, or its not in which case

Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-27 Thread Peter Zijlstra
On Fri, 2012-07-20 at 05:31 -0700, Michel Lespinasse wrote: --- a/lib/rbtree_test.c +++ b/lib/rbtree_test.c @@ -1,5 +1,6 @@ #include linux/module.h #include linux/rbtree.h +#include linux/rbtree_internal.h This confuses me.. either its internal to the rb-tree implementation and users

Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-27 Thread Peter Zijlstra
On Fri, 2012-07-20 at 05:31 -0700, Michel Lespinasse wrote: +static inline void +rb_erase_augmented(struct rb_node *node, struct rb_root *root, + rb_augment_propagate *augment_propagate, + rb_augment_rotate *augment_rotate) So why put all this in a static

Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-27 Thread Michel Lespinasse
On Fri, Jul 27, 2012 at 1:02 PM, Peter Zijlstra pet...@infradead.org wrote: On Fri, 2012-07-20 at 05:31 -0700, Michel Lespinasse wrote: --- a/lib/rbtree_test.c +++ b/lib/rbtree_test.c @@ -1,5 +1,6 @@ #include linux/module.h #include linux/rbtree.h +#include linux/rbtree_internal.h This

Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-27 Thread Michel Lespinasse
On Fri, Jul 27, 2012 at 5:44 PM, Michel Lespinasse wal...@google.com wrote: On Fri, Jul 27, 2012 at 1:02 PM, Peter Zijlstra pet...@infradead.org wrote: As it stands rb_erase() isn't inlined and its rather big, why would you want to inline it for augmented callers? Just as the non-augmented

Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-25 Thread Rik van Riel
On 07/23/2012 09:54 PM, Michel Lespinasse wrote: Add an augmented tree rotation callback to __rb_erase_color(), so that augmented tree information can be maintained while rebalancing. Also introduce rb_erase_augmented(), which is a version of rb_erase() with augmented tree callbacks. We need

Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-25 Thread Rik van Riel
On 07/23/2012 09:54 PM, Michel Lespinasse wrote: Add an augmented tree rotation callback to __rb_erase_color(), so that augmented tree information can be maintained while rebalancing. Also introduce rb_erase_augmented(), which is a version of rb_erase() with augmented tree callbacks. We need

Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-23 Thread Michel Lespinasse
Add an augmented tree rotation callback to __rb_erase_color(), so that augmented tree information can be maintained while rebalancing. Also introduce rb_erase_augmented(), which is a version of rb_erase() with augmented tree callbacks. We need three callbacks here: one to copy the subtree's

Re: [PATCH 5/6] rbtree: faster augmented erase

2012-07-23 Thread Michel Lespinasse
Add an augmented tree rotation callback to __rb_erase_color(), so that augmented tree information can be maintained while rebalancing. Also introduce rb_erase_augmented(), which is a version of rb_erase() with augmented tree callbacks. We need three callbacks here: one to copy the subtree's

[PATCH 5/6] rbtree: faster augmented erase

2012-07-20 Thread Michel Lespinasse
Add an augmented tree rotation callback to __rb_erase_color(), so that augmented tree information can be maintained while rebalancing. Also introduce rb_erase_augmented(), which is a version of rb_erase() with augmented tree callbacks. We need two callbacks here: one to propagate the augmented

[PATCH 5/6] rbtree: faster augmented erase

2012-07-20 Thread Michel Lespinasse
Add an augmented tree rotation callback to __rb_erase_color(), so that augmented tree information can be maintained while rebalancing. Also introduce rb_erase_augmented(), which is a version of rb_erase() with augmented tree callbacks. We need two callbacks here: one to propagate the augmented