public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Jamie Lokier <lk@tantalophile.demon.co.uk>
Cc: Andrew Morton <akpm@digeo.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	William Lee Irwin III <wli@holomorphy.com>
Subject: Re: rbtree scores (was Re: [patch] deadline-ioscheduler rb-tree sort)
Date: Sat, 2 Nov 2002 09:59:47 +0100	[thread overview]
Message-ID: <20021102085947.GJ807@suse.de> (raw)
In-Reply-To: <20021101205532.GB1780@bjl1.asuk.net>

On Fri, Nov 01 2002, Jamie Lokier wrote:
> Andrew Morton wrote:
> > Jens Axboe wrote:
> > > 
> > > As expected, the stock version O(N) insertion scan really hurts. Even
> > > with 128 requests per list, rbtree version is far superior. Once bigger
> > > lists are used, there's just no comparison whatsoever.
> > > 
> > 
> > Jens,  the tree just makes sense.
> 
> Just a few comments about data structures - not important.
> 
> Technically I think that a priority queue, i.e. a heap (partially
> ordered tree) is sufficient for the request queue.  I don't know the
> request queue code well enough to be sure, though.

I looked into that as well, and I do have a generic binomial heap
implementation that I plan on test as well.

> If it was worth it (I suspect not), you can make a data structure
> which has O(1) amortised insertion time for a number of common cases,
> such as runs of ascending block numbers.  Seems a likely pattern for a
> filesystem...

Fibonacci heaps, for instance. I looked into that as well. However, it's
actually more important to have (if possible) O(1) extraction than
insert. Extraction is typically run from interrupt context, when a
driver wants to requeue more requests because it has completed one (or
some). That was a worry with the rbtree solution. The linked list may
have had sucky O(N) insert, but extraction was a nice O(1). So far I
haven't been able to notice any regression in this area, regardless.

> Implementing the latter would likely be a lot of work for little gain
> though.

Indeed

-- 
Jens Axboe


  reply	other threads:[~2002-11-02  8:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-31 13:43 [patch] deadline-ioscheduler rb-tree sort Jens Axboe
2002-11-01 11:34 ` rbtree scores (was Re: [patch] deadline-ioscheduler rb-tree sort) Jens Axboe
2002-11-01 19:34   ` Andrew Morton
2002-11-01 20:55     ` Jamie Lokier
2002-11-02  8:59       ` Jens Axboe [this message]
2002-11-02 20:22         ` Jamie Lokier
2002-11-02  8:57     ` Jens Axboe

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=20021102085947.GJ807@suse.de \
    --to=axboe@suse.de \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lk@tantalophile.demon.co.uk \
    --cc=wli@holomorphy.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