Re: [PATCH v2 2/9] rbtree: optimize fetching of sibling node

2012-08-06 Thread Michel Lespinasse
On Mon, Aug 6, 2012 at 7:23 AM, Peter Zijlstra wrote: > On Thu, 2012-08-02 at 15:34 -0700, Michel Lespinasse wrote: > >> + tmp = gparent->rb_right; >> + if (parent != tmp) {/* parent == gparent->rb_left */ > >> + tmp = parent->rb_right; >> +

Re: [PATCH v2 2/9] rbtree: optimize fetching of sibling node

2012-08-06 Thread Peter Zijlstra
On Thu, 2012-08-02 at 15:34 -0700, Michel Lespinasse wrote: > + tmp = gparent->rb_right; > + if (parent != tmp) {/* parent == gparent->rb_left */ > + tmp = parent->rb_right; > + if (node == tmp) { > + tmp = p

Re: [PATCH v2 2/9] rbtree: optimize fetching of sibling node

2012-08-05 Thread Rik van Riel
On 08/02/2012 06:34 PM, Michel Lespinasse wrote: When looking to fetch a node's sibling, we went through a sequence of: - check if node is the parent's left child - if it is, then fetch the parent's right child This can be replaced with: - fetch the parent's right child as an assumed sibling - c

[PATCH v2 2/9] rbtree: optimize fetching of sibling node

2012-08-02 Thread Michel Lespinasse
When looking to fetch a node's sibling, we went through a sequence of: - check if node is the parent's left child - if it is, then fetch the parent's right child This can be replaced with: - fetch the parent's right child as an assumed sibling - check that node is NOT the fetched child This avoid