From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 3/3] xfs: Sort delayed write buffers before dispatch
Date: Fri, 8 Jan 2010 06:11:52 -0500 [thread overview]
Message-ID: <20100108111152.GA29812@infradead.org> (raw)
In-Reply-To: <1262649861-28530-4-git-send-email-david@fromorbit.com>
> +/*
> + * Compare function is more complex than it needs to be because
> + * the return value is only 32 bits and we are doing comparisons
> + * on 64 bit values
> + */
> +int
> +xfs_buf_cmp(
Should be marked static.
> +void
> +xfs_buf_delwri_sort(
> + xfs_buftarg_t *target,
> + struct list_head *list)
> +{
> + list_sort(NULL, list, xfs_buf_cmp);
> +}
Same here. Not sure I would even bother with the wrapper. Also the
first argument is entirely unused.
> STATIC int
> xfsbufd(
> void *data)
> {
> + xfs_buftarg_t *target = (xfs_buftarg_t *)data;
>
> current->flags |= PF_MEMALLOC;
>
> @@ -1739,6 +1774,8 @@ xfsbufd(
> do {
> long age = xfs_buf_age_centisecs * msecs_to_jiffies(10);
> long tout = age;
> + int count = 0;
> + struct list_head tmp;
>
> if (unlikely(freezing(current))) {
> set_bit(XBT_FORCE_SLEEP, &target->bt_flags);
> @@ -1753,11 +1790,10 @@ xfsbufd(
> schedule_timeout_interruptible(tout);
>
> xfs_buf_delwri_split(target, &tmp, age);
> + xfs_buf_delwri_sort(target, &tmp);
> while (!list_empty(&tmp)) {
> + struct xfs_buf *bp;
> + bp = list_first_entry(&tmp, struct xfs_buf, b_list);
> list_del_init(&bp->b_list);
> xfs_buf_iostrategy(bp);
> count++;
>
>
> if (wait)
> blk_run_address_space(target->bt_mapping);
>
> + /* Now wait for IO to complete if required. */
> + while (!list_empty(&wait_list)) {
> + bp = list_first_entry(&wait_list, struct xfs_buf, b_list);
>
> list_del_init(&bp->b_list);
> xfs_iowait(bp);
As a tiny optimization you might want to move this into the if (wait)
block
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-01-08 11:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-05 0:04 [PATCH 0/3] Kill async inode writeback V2 Dave Chinner
2010-01-05 0:04 ` [PATCH 1/3] xfs: Use delayed write for inodes rather than async Dave Chinner
2010-01-08 10:36 ` Christoph Hellwig
2010-01-08 11:05 ` Dave Chinner
2010-01-08 11:14 ` Christoph Hellwig
2010-01-05 0:04 ` [PATCH 2/3] xfs: Don't issue buffer IO direct from AIL push Dave Chinner
2010-01-08 11:07 ` Christoph Hellwig
2010-01-08 11:15 ` 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 [this message]
2010-01-08 11:17 ` Dave Chinner
2010-01-06 18:08 ` [PATCH 0/3] Kill async inode writeback V2 Christoph Hellwig
2010-01-06 22:49 ` Dave Chinner
2010-01-08 10:14 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2010-01-02 3:03 [RFC, PATCH 0/3] Kill async inode writeback 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
2010-01-02 14:14 ` Dave Chinner
2010-01-04 15:43 ` Christoph Hellwig
2010-01-04 23:53 ` 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=20100108111152.GA29812@infradead.org \
--to=hch@infradead.org \
--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