[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <501F20BC.2030107@redhat.com>
Date: Sun, 05 Aug 2012 21:41:16 -0400
From: Rik van Riel <riel@...hat.com>
To: Michel Lespinasse <walken@...gle.com>
CC: peterz@...radead.org, 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 6/9] rbtree: low level optimizations in rb_erase()
On 08/02/2012 06:34 PM, Michel Lespinasse wrote:
> Various minor optimizations in rb_erase():
> - Avoid multiple loading of node->__rb_parent_color when computing parent
> and color information (possibly not in close sequence, as there might
> be further branches in the algorithm)
> - In the 1-child subcase of case 1, copy the __rb_parent_color field from
> the erased node to the child instead of recomputing it from the desired
> parent and color
> - When searching for the erased node's successor, differentiate between
> cases 2 and 3 based on whether any left links were followed. This avoids
> a condition later down.
> - In case 3, keep a pointer to the erased node's right child so we don't
> have to refetch it later to adjust its parent.
> - In the no-childs subcase of cases 2 and 3, place the rebalance assigment
> last so that the compiler can remove the following if(rebalance) test.
>
> Also, added some comments to illustrate cases 2 and 3.
>
> Signed-off-by: Michel Lespinasse<walken@...gle.com>
Acked-by: Rik van Riel <riel@...hat.com>
--
All rights reversed
--
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