From: Andi Kleen <andi@firstfloor.org>
To: Dave Chinner <david@fromorbit.com>
Cc: axboe@kernel.dk, xfs@oss.sgi.com
Subject: Re: [PATCH 3/3] XFS: Sort delayed write buffers before dispatch
Date: Sat, 02 Jan 2010 14:08:36 +0100 [thread overview]
Message-ID: <87fx6o7iy3.fsf@basil.nowhere.org> (raw)
In-Reply-To: <1262401416-19546-4-git-send-email-david@fromorbit.com> (Dave Chinner's message of "Sat, 2 Jan 2010 14:03:36 +1100")
Dave Chinner <david@fromorbit.com> writes:
> Currently when the xfsbufd writes delayed write buffers, it pushes
> them to disk in the order they come off the delayed write list. If
> there are lots of buffers Ñpread widely over the disk, this results
> in overwhelming the elevator sort queues in the block layer and we
> end up losing the posibility of merging adjacent buffers to minimise
> the number of IOs.
>
> Add a sort array to the buftarg so that we can do high level sorting
> of the buffers once they are pulled off the delwri queue for
> writeback. Currently this array can hold 4096 buffers at a time
> which gives us a window 32 times larger than the default elevator
> maximums for ordering buffers.
At first look it seems a bit wasteful because the elevator
sorts again. Is your window that much bigger than the elevators?
Perhaps the sort queue in the elevator should be just enlarged?
>
> Ideally this should use a list sort rather than requiring an
> external buffer to sort the buffers in, but for simplicity
> just do it via sort function.
Doing merge sort on lists is relatively simple There are
plenty examples in a google search. An alternative is also
to construct a rbtree on the fly and then walk it.
But if you use sort() this way you probably should at least
add a u64 swap function to lib/sort.c, otherwise
all the pointers will be exchanged byte-by-byte on 64bit
systems which is rather slow.
-andi
--
ak@linux.intel.com -- Speaking for myself only.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-01-02 13:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-02 3:03 [RFC, PATCH 0/3] Kill async inode writeback Dave Chinner
2010-01-02 3:03 ` [PATCH 1/3] XFS: Use delayed write for inodes rather than async Dave Chinner
2010-01-02 3:03 ` [PATCH 2/3] XFS: Don't issue buffer IO direct from AIL push Dave Chinner
2010-01-02 3:03 ` [PATCH 3/3] XFS: Sort delayed write buffers before dispatch Dave Chinner
2010-01-02 13:08 ` Andi Kleen [this message]
2010-01-02 14:14 ` Dave Chinner
2010-01-04 15:43 ` Christoph Hellwig
2010-01-04 23:53 ` Dave Chinner
-- strict thread matches above, loose matches on Subject: below --
2010-01-05 0:04 [PATCH 0/3] Kill async inode writeback V2 Dave Chinner
2010-01-05 0:04 ` [PATCH 3/3] xfs: Sort delayed write buffers before dispatch Dave Chinner
2010-01-08 11:11 ` Christoph Hellwig
2010-01-08 11:17 ` Dave Chinner
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=87fx6o7iy3.fsf@basil.nowhere.org \
--to=andi@firstfloor.org \
--cc=axboe@kernel.dk \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.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