mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Jan Kara <jack@suse.cz>,
	mingo@kernel.org, peterz@infradead.org,
	akpm@linux-foundation.org, kirill.shutemov@linux.intel.com,
	ldufour@linux.vnet.ibm.com, mhocko@suse.com,
	mgorman@techsingularity.net, linux-kernel@vger.kernel.org,
	Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 1/8] rbtree: Cache leftmost node internally
Date: Mon, 12 Jun 2017 11:47:20 +0200	[thread overview]
Message-ID: <20170612094720.GB22728@quack2.suse.cz> (raw)
In-Reply-To: <20170609143250.GB20320@linux-80c1.suse>

On Fri 09-06-17 07:32:50, Davidlohr Bueso wrote:
> >>@@ -150,6 +161,7 @@ extern void __rb_erase_color(struct rb_node *parent, struct rb_root *root,
> >>
> >> static __always_inline struct rb_node *
> >> __rb_erase_augmented(struct rb_node *node, struct rb_root *root,
> >>+		     struct rb_node **leftmost,
> >> 		     const struct rb_augment_callbacks *augment)
> >> {
> >> 	struct rb_node *child = node->rb_right;
> >>@@ -157,6 +169,9 @@ __rb_erase_augmented(struct rb_node *node, struct rb_root *root,
> >> 	struct rb_node *parent, *rebalance;
> >> 	unsigned long pc;
> >>
> >>+	if (leftmost && node == *leftmost)
> >>+		*leftmost = rb_next(node);
> >>+
> >> 	if (!tmp) {
> >> 		/*
> >> 		 * Case 1: node to erase has no more than 1 child (easy!)
> >
> >Why do you propagate e.g. 'leftmost' down to __rb_erase_augmented() when
> >you could just handle everything within rb_erase_augmented_cached?
> >Similarly for other functions like __rb_insert()... It would seem like less
> >churn and I don't see downside to it...
> 
> I propagate args so we don't have to duplicate the checks between the regular
> and augmented rbtrees.

OK, yeah. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2017-06-12  9:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08 18:03 [PATCH -next v2 0/8] " Davidlohr Bueso
2017-06-08 18:03 ` [PATCH 1/8] " Davidlohr Bueso
2017-06-09  7:43   ` Jan Kara
2017-06-09 14:32     ` Davidlohr Bueso
2017-06-12  9:47       ` Jan Kara [this message]
2017-06-08 18:03 ` [PATCH 2/8] sched/fair: Replace cfs_rq->rb_leftmost Davidlohr Bueso
2017-06-08 18:03 ` [PATCH 3/8] sched/deadline: Replace earliest dl and rq leftmost caching Davidlohr Bueso
2017-06-08 18:03 ` [PATCH 4/8] locking/rtmutex: Replace top-waiter and pi_waiters " Davidlohr Bueso
2017-06-08 18:03 ` [PATCH 5/8] lib/interval_tree: Fast overlap detection Davidlohr Bueso
2017-06-09  8:15   ` Christian König
2017-06-08 18:03 ` [PATCH 6/8] lib/interval-tree: Correct comment wrt generic flavor Davidlohr Bueso
2017-06-08 18:03 ` [PATCH 7/8] procfs: Use faster rb_first_cached() Davidlohr Bueso
2017-06-08 18:03 ` [PATCH 8/8] fs/epoll: " Davidlohr Bueso

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=20170612094720.GB22728@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=ldufour@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /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

all inboxes | Powered by JetHome®