From: Jamie Lokier <lk@tantalophile.demon.co.uk>
To: Andrew Morton <akpm@digeo.com>
Cc: Jens Axboe <axboe@suse.de>,
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: Fri, 1 Nov 2002 20:55:32 +0000 [thread overview]
Message-ID: <20021101205532.GB1780@bjl1.asuk.net> (raw)
In-Reply-To: <3DC2D72B.B4D5707E@digeo.com>
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.
Both heaps and trees are O(N log N), the difference being that an
rbtree does a bit more constant-time work to balance the tree while
maintaining a stricter ordering.
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...
Implementing the latter would likely be a lot of work for little gain
though.
-- Jamie
next prev parent reply other threads:[~2002-11-01 20:49 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 [this message]
2002-11-02 8:59 ` Jens Axboe
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=20021101205532.GB1780@bjl1.asuk.net \
--to=lk@tantalophile.demon.co.uk \
--cc=akpm@digeo.com \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®