[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190628171416.by5gdizl3rcxk5h5@linux-r8p5>
Date: Fri, 28 Jun 2019 10:14:16 -0700
From: Davidlohr Bueso <dave@...olabs.net>
To: Michel Lespinasse <walken@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
David Howells <dhowells@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rbtree: avoid generating code twice for the cached
versions
On Thu, 27 Jun 2019, Michel Lespinasse wrote:
>As was already noted in rbtree.h, the logic to cache rb_first (or rb_last)
>can easily be implemented externally to the core rbtree api.
>
>Change the implementation to do just that. Previously the update of
>rb_leftmost was wired deeper into the implemntation, but there were
>some disadvantages to that - mostly, lib/rbtree.c had separate
>instantiations for rb_insert_color() vs rb_insert_color_cached(), as well
>as rb_erase() vs rb_erase_cached(), which were doing exactly the same
>thing save for the rb_leftmost update at the start of either function.
Also:
text data bss dec hex filename
5405 120 0 5525 1595 lib/rbtree.o-vanilla
3827 96 0 3923 f53 lib/rbtree.o-patch
Powered by blists - more mailing lists