[lkml]   [2002]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: rbtree scores (was Re: [patch] deadline-ioscheduler rb-tree sort)
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

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

-- Jamie
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:30    [W:0.048 / U:3.420 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site