public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/5] xfs: Introduce writeback context for writepages
Date: Tue, 9 Feb 2016 05:39:41 -0800	[thread overview]
Message-ID: <20160209133941.GA13357@infradead.org> (raw)
In-Reply-To: <1454910258-7578-3-git-send-email-david@fromorbit.com>

This looks good in general and now passes testing for me.  A couple
comments below:

>  
>  /*
> - * Cancel submission of all buffer_heads so far in this endio.
> - * Toss the endio too.  Only ever called for the initial page
> - * in a writepage request, so only ever one page.
> - */
> -STATIC void
> -xfs_cancel_ioend(
> -	xfs_ioend_t		*ioend)
> -{
> -	xfs_ioend_t		*next;
> -	struct buffer_head	*bh, *next_bh;
> -
> -	do {
> -		next = ioend->io_list;
> -		bh = ioend->io_buffer_head;
> -		do {
> -			next_bh = bh->b_private;
> -			clear_buffer_async_write(bh);
> -			/*
> -			 * The unwritten flag is cleared when added to the
> -			 * ioend. We're not submitting for I/O so mark the
> -			 * buffer unwritten again for next time around.
> -			 */
> -			if (ioend->io_type == XFS_IO_UNWRITTEN)
> -				set_buffer_unwritten(bh);
> -			unlock_buffer(bh);
> -		} while ((bh = next_bh) != NULL);
> -
> -		mempool_free(ioend, xfs_ioend_pool);
> -	} while ((ioend = next) != NULL);
> -}

Removing xfs_cancel_ioend and replacing it with the start and cancel
writeback scheme that we currently only use for
xfs_setfilesize_trans_alloc failures actually seems to be the biggest
change in this patch and is entirely undocumented.  Any chance you
could split this into a prep patch and properly document it?

> -
> -	if (!ioend || need_ioend || type != ioend->io_type) {
> -		xfs_ioend_t	*previous = *result;
> -
> -		ioend = xfs_alloc_ioend(inode, type);
> -		ioend->io_offset = offset;
> -		ioend->io_buffer_head = bh;
> -		ioend->io_buffer_tail = bh;
> -		if (previous)
> -			previous->io_list = ioend;
> -		*result = ioend;
> +	if (!wpc->ioend || wpc->io_type != wpc->ioend->io_type ||
> +	    bh->b_blocknr != wpc->last_block + 1) {

We now start a new ioend if the blocks aren't contiguous, which seems
reasonable.  But this also means the similar check in xfs_submit_ioend
should be removed at the same time.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2016-02-09 13:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08  5:44 [PATCH 0/5 v3] xfs: get rid of xfs_cluster_write() Dave Chinner
2016-02-08  5:44 ` [PATCH 1/5] xfs: remove nonblocking mode from xfs_vm_writepage Dave Chinner
2016-02-08  5:44 ` [PATCH 2/5] xfs: Introduce writeback context for writepages Dave Chinner
2016-02-09 13:39   ` Christoph Hellwig [this message]
2016-02-09 21:48     ` Dave Chinner
2016-02-09 23:16       ` Dave Chinner
2016-02-09 14:22   ` Brian Foster
2016-02-09 21:51     ` Dave Chinner
2016-02-08  5:44 ` [PATCH 3/5] xfs: xfs_cluster_write is redundant Dave Chinner
2016-02-09 13:40   ` Christoph Hellwig
2016-02-08  5:44 ` [PATCH 4/5] xfs: factor mapping out of xfs_do_writepage Dave Chinner
2016-02-09 13:40   ` Christoph Hellwig
2016-02-08  5:44 ` [PATCH 5/5] xfs: don't chain ioends during writepage submission Dave Chinner
2016-02-09 13:49   ` Christoph Hellwig
2016-02-09 21:52     ` Dave Chinner
2016-02-09 14:23   ` Brian Foster
2016-02-09 21:59     ` Dave Chinner
2016-02-10 13:18       ` Brian Foster
2016-02-10 21:09         ` Dave Chinner
2016-02-11 12:24           ` Brian Foster

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=20160209133941.GA13357@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