All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
To: Kent Overstreet <koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org,
	paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org,
	Daniel Santos <danielfsantos-fOdFMYwuEsI@public.gmane.org>
Subject: Re: [PATCH 0/3] Generic rb tree code
Date: Thu, 31 May 2012 23:03:35 +0200	[thread overview]
Message-ID: <20120531210335.GC16338@quack.suse.cz> (raw)
In-Reply-To: <1337979461-19654-1-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

On Fri 25-05-12 13:57:38, Kent Overstreet wrote:
> Right now, users of the rb tree code have to open code their own search and
> insert functions. This provides generic versions that you pass a comparison
> function to.
> 
> I highly doubt the extra function calls are going to have a measurable
> performance impact in practice - the pointer chasing is going to dominate. I
> did provide inline versions just in case, though - it's modelled after the
> spinlock code.
> 
> The inline version of rb_search() is important for another reason, though - you
> have to pass rb_search a pointer to your struct for it to compare against,
> which has to be allocated on the stack. For most users I think that'll be fine,
> but for the elevator code struct rb_node is embedded in struct request, which
> is rather large. By using the inline version that stack allocation goes away.
> 
> (I looked at the generated assembly of elv_rb_find() before and after, and if
> I'm reading it right it's not using any extra stack. Code is a bit worse, but
> IMO removing code duplication is worth it).
> 
> Kent Overstreet (3):
>   rbtree: Add rb_insert(), rb_search(), etc.
>   timerqueue: convert to generic rb tree code
>   block: convert elevator to generic rb tree code
  Hum, are you aware of another generic rb-tree attempt -
 https://lkml.org/lkml/2012/4/30/132 ?

								Honza
-- 
Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
SUSE Labs, CR

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kara <jack@suse.cz>
To: Kent Overstreet <koverstreet@google.com>
Cc: linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org,
	tj@kernel.org, axboe@kernel.dk, paul.gortmaker@windriver.com,
	Daniel Santos <danielfsantos@att.net>
Subject: Re: [PATCH 0/3] Generic rb tree code
Date: Thu, 31 May 2012 23:03:35 +0200	[thread overview]
Message-ID: <20120531210335.GC16338@quack.suse.cz> (raw)
In-Reply-To: <1337979461-19654-1-git-send-email-koverstreet@google.com>

On Fri 25-05-12 13:57:38, Kent Overstreet wrote:
> Right now, users of the rb tree code have to open code their own search and
> insert functions. This provides generic versions that you pass a comparison
> function to.
> 
> I highly doubt the extra function calls are going to have a measurable
> performance impact in practice - the pointer chasing is going to dominate. I
> did provide inline versions just in case, though - it's modelled after the
> spinlock code.
> 
> The inline version of rb_search() is important for another reason, though - you
> have to pass rb_search a pointer to your struct for it to compare against,
> which has to be allocated on the stack. For most users I think that'll be fine,
> but for the elevator code struct rb_node is embedded in struct request, which
> is rather large. By using the inline version that stack allocation goes away.
> 
> (I looked at the generated assembly of elv_rb_find() before and after, and if
> I'm reading it right it's not using any extra stack. Code is a bit worse, but
> IMO removing code duplication is worth it).
> 
> Kent Overstreet (3):
>   rbtree: Add rb_insert(), rb_search(), etc.
>   timerqueue: convert to generic rb tree code
>   block: convert elevator to generic rb tree code
  Hum, are you aware of another generic rb-tree attempt -
 https://lkml.org/lkml/2012/4/30/132 ?

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

  parent reply	other threads:[~2012-05-31 21:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-25 20:57 [PATCH 0/3] Generic rb tree code Kent Overstreet
2012-05-25 20:57 ` [PATCH 1/3] rbtree: Add rb_insert(), rb_search(), etc Kent Overstreet
     [not found]   ` <1337979461-19654-2-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-05-28 23:35     ` Tejun Heo
2012-05-28 23:35       ` Tejun Heo
2012-05-25 20:57 ` [PATCH 2/3] timerqueue: convert to generic rb tree code Kent Overstreet
2012-05-25 20:57 ` [PATCH 3/3] block: convert elevator " Kent Overstreet
     [not found]   ` <1337979461-19654-4-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-05-28 23:17     ` Tejun Heo
2012-05-28 23:17       ` Tejun Heo
2012-05-29  3:25       ` Kent Overstreet
     [not found]         ` <20120529032502.GA10175-RcKxWJ4Cfj3IzGYXcIpNmNLIRw13R84JkQQo+JxHRPFibQn6LdNjmg@public.gmane.org>
2012-05-29  5:24           ` Tejun Heo
2012-05-29  5:24             ` Tejun Heo
     [not found]             ` <20120529052458.GA17366-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-05-29  6:57               ` Kent Overstreet
2012-05-29  6:57                 ` Kent Overstreet
     [not found] ` <1337979461-19654-1-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-05-28 23:22   ` [PATCH 0/3] Generic " Tejun Heo
2012-05-28 23:22     ` Tejun Heo
     [not found]     ` <20120528232246.GC20954-RcKxWJ4Cfj1J2suj2OqeGauc2jM2gXBXkQQo+JxHRPFibQn6LdNjmg@public.gmane.org>
2012-05-29  3:30       ` Kent Overstreet
2012-05-29  3:30         ` Kent Overstreet
     [not found]         ` <20120529033032.GB10175-RcKxWJ4Cfj3IzGYXcIpNmNLIRw13R84JkQQo+JxHRPFibQn6LdNjmg@public.gmane.org>
2012-05-29  5:28           ` Tejun Heo
2012-05-29  5:28             ` Tejun Heo
2012-05-31 21:03   ` Jan Kara [this message]
2012-05-31 21:03     ` Jan Kara

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=20120531210335.GC16338@quack.suse.cz \
    --to=jack-alswssmvlrq@public.gmane.org \
    --cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
    --cc=danielfsantos-fOdFMYwuEsI@public.gmane.org \
    --cc=koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.