mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Michel Lespinasse <walken@google.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	David Howells <dhowells@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rbtree: avoid generating code twice for the cached versions
Date: Mon, 1 Jul 2019 09:26:45 +0200	[thread overview]
Message-ID: <20190701072645.GK3402@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190628045008.39926-1-walken@google.com>

On Thu, Jun 27, 2019 at 09:50:08PM -0700, 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.
> 

> Signed-off-by: Michel Lespinasse <walken@google.com>
> ---
>  include/linux/rbtree.h           | 70 +++++++++++++++++++++-----------
>  include/linux/rbtree_augmented.h | 27 +++++-------
>  lib/rbtree.c                     | 40 ++----------------
>  3 files changed, 59 insertions(+), 78 deletions(-)

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

      parent reply	other threads:[~2019-07-01  7:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28  4:50 Michel Lespinasse
2019-06-28 16:56 ` Davidlohr Bueso
2019-06-28 22:07   ` Michel Lespinasse
2019-06-28 17:14 ` Davidlohr Bueso
2019-07-01  7:26 ` Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190701072645.GK3402@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=walken@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome