[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANN689EHcas5zFyNeDzpapO_ddQiMjbfSwPvjcYQM8ce-Z_zVQ@mail.gmail.com>
Date: Mon, 6 Aug 2012 13:46:12 -0700
From: Michel Lespinasse <walken@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: riel@...hat.com, daniel.santos@...ox.com, aarcange@...hat.com,
dwmw2@...radead.org, akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org
Subject: Re: [PATCH v2 2/9] rbtree: optimize fetching of sibling node
On Mon, Aug 6, 2012 at 7:23 AM, Peter Zijlstra <peterz@...radead.org> 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;
>> + if (node == tmp) {
>
>> + tmp = parent->rb_left;
>> + if (node == tmp) {
>
>> + sibling = parent->rb_right;
>> + if (node != sibling) { /* node == parent->rb_left */
>
> Half of them got a comment, the other half didn't.. is there any
> particular reason for that?
I felt that the equality tests didn't need explanation. But the tests
where I test for inequality with the supposed sibling didn't seem
quite so obvious to me, so I commented them.
--
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists