linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@lst.de>,
	"Darrick J . Wong" <darrick.wong@oracle.com>,
	Damien Le Moal <Damien.LeMoal@wdc.com>,
	Andreas Gruenbacher <agruenba@redhat.com>,
	linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 09/12] iomap: lift the xfs writeback code to iomap
Date: Wed, 16 Oct 2019 09:48:36 +0200	[thread overview]
Message-ID: <20191016074836.GB23696@lst.de> (raw)
In-Reply-To: <20191015220721.GC16973@dread.disaster.area>

On Wed, Oct 16, 2019 at 09:07:21AM +1100, Dave Chinner wrote:
> > +	trace_iomap_releasepage(page->mapping->host, page, 0, 0);
> > +
> >  	/*
> >  	 * mm accommodates an old ext3 case where clean pages might not have had
> >  	 * the dirty bit cleared. Thus, it can send actual dirty pages to
> > @@ -483,6 +488,8 @@ EXPORT_SYMBOL_GPL(iomap_releasepage);
> >  void
> >  iomap_invalidatepage(struct page *page, unsigned int offset, unsigned int len)
> >  {
> > +	trace_iomap_invalidatepage(page->mapping->host, page, offset, len);
> > +
> 
> These tracepoints should be split out into a separate patch like
> the readpage(s) tracepoints. Maybe just lift all the non-writeback
> ones in a single patch...

I guess that makes sense.  Initially I didn't want to duplicate the
trace definition as it is shared with the writeback tracepoints,
but in the overall scheme of things that doesn't really matter.

> > +iomap_finish_page_writeback(struct inode *inode, struct bio_vec *bvec,
> > +		int error)
> > +{
> > +	struct iomap_page *iop = to_iomap_page(bvec->bv_page);
> > +
> > +	if (error) {
> > +		SetPageError(bvec->bv_page);
> > +		mapping_set_error(inode->i_mapping, -EIO);
> > +	}
> > +
> > +	WARN_ON_ONCE(i_blocksize(inode) < PAGE_SIZE && !iop);
> > +	WARN_ON_ONCE(iop && atomic_read(&iop->write_count) <= 0);
> > +
> > +	if (!iop || atomic_dec_and_test(&iop->write_count))
> > +		end_page_writeback(bvec->bv_page);
> > +}
> 
> Can we just pass the struct page into this function?

I'd rather not change calling conventions in code just moved over for
no good reason.  That being said I agree with passing a page, so I'll
just throw in a follow on patch like I did for iomap_ioend_compare
cleanup.

> 
> .....
> 
> > +/*
> > + * Submit the bio for an ioend. We are passed an ioend with a bio attached to
> > + * it, and we submit that bio. The ioend may be used for multiple bio
> > + * submissions, so we only want to allocate an append transaction for the ioend
> > + * once.  In the case of multiple bio submission, each bio will take an IO
> 
> This needs to be changed to describe what wpc->ops->submit_ioend()
> is used for rather than what XFS might use this hook for.

True.  The real documentation now is in the header near the ops defintion,
but I'll update this one to make more sense as well.

> > +static int
> > +iomap_submit_ioend(struct iomap_writepage_ctx *wpc, struct iomap_ioend *ioend,
> > +		int error)
> > +{
> > +	ioend->io_bio->bi_private = ioend;
> > +	ioend->io_bio->bi_end_io = iomap_writepage_end_bio;
> > +
> > +	if (wpc->ops->submit_ioend)
> > +		error = wpc->ops->submit_ioend(ioend, error);
> 
> I'm not sure that "submit_ioend" is the best name for this method,
> as it is a pre-bio-submission hook, not an actual IO submission
> method. "prepare_ioend_for_submit" is more descriptive, but probably
> too long. wpc->ops->prepare_submit(ioend, error) reads pretty well,
> though...

Not a huge fan of that name either, but Brian complained.  Let's hold
a popular vote for a name and see if we have a winner.

As for the grammar comments - all this is copied over as-is.  I'll add
another patch to fix that up.


  parent reply	other threads:[~2019-10-16  7:48 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 15:43 lift the xfs writepage code into iomap v7 Christoph Hellwig
2019-10-15 15:43 ` [PATCH 01/12] xfs: initialize iomap->flags in xfs_bmbt_to_iomap Christoph Hellwig
2019-10-15 18:00   ` Darrick J. Wong
2019-10-15 21:20   ` Dave Chinner
2019-10-15 15:43 ` [PATCH 02/12] xfs: set IOMAP_F_NEW more carefully Christoph Hellwig
2019-10-15 18:01   ` Darrick J. Wong
2019-10-15 21:21   ` Dave Chinner
2019-10-15 15:43 ` [PATCH 03/12] xfs: use a struct iomap in xfs_writepage_ctx Christoph Hellwig
2019-10-15 21:23   ` Dave Chinner
2019-10-15 15:43 ` [PATCH 04/12] xfs: refactor the ioend merging code Christoph Hellwig
2019-10-15 17:56   ` Darrick J. Wong
2019-10-15 17:59     ` Christoph Hellwig
2019-10-15 21:26   ` Dave Chinner
2019-10-15 15:43 ` [PATCH 05/12] xfs: turn io_append_trans into an io_private void pointer Christoph Hellwig
2019-10-15 18:02   ` Darrick J. Wong
2019-10-15 21:28   ` Dave Chinner
2019-10-15 15:43 ` [PATCH 06/12] xfs: remove the fork fields in the writepage_ctx and ioend Christoph Hellwig
2019-10-15 18:05   ` Darrick J. Wong
2019-10-15 21:31   ` Dave Chinner
2019-10-15 15:43 ` [PATCH 07/12] iomap: zero newly allocated mapped blocks Christoph Hellwig
2019-10-15 21:32   ` Dave Chinner
2019-10-15 15:43 ` [PATCH 08/12] iomap: lift the xfs readpage / readpages tracing to iomap Christoph Hellwig
2019-10-15 18:06   ` Darrick J. Wong
2019-10-15 21:35   ` Dave Chinner
2019-10-15 15:43 ` [PATCH 09/12] iomap: lift the xfs writeback code " Christoph Hellwig
2019-10-15 18:40   ` Darrick J. Wong
2019-10-16  7:43     ` Christoph Hellwig
2019-10-15 22:07   ` Dave Chinner
2019-10-16  5:09     ` Darrick J. Wong
2019-10-16  7:48     ` Christoph Hellwig [this message]
2019-10-16 12:08       ` Brian Foster
2019-10-16  8:10     ` Christoph Hellwig
2019-10-15 15:43 ` [PATCH 10/12] iomap: warn on inline maps in iomap_writepage_map Christoph Hellwig
2019-10-15 22:08   ` Dave Chinner
2019-10-15 15:43 ` [PATCH 11/12] iomap: move struct iomap_page out of iomap.h Christoph Hellwig
2019-10-15 22:09   ` Dave Chinner
2019-10-15 15:43 ` [PATCH 12/12] iomap: cleanup iomap_ioend_compare Christoph Hellwig
2019-10-15 17:57   ` Darrick J. Wong
2019-10-15 22:10   ` 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=20191016074836.GB23696@lst.de \
    --to=hch@lst.de \
    --cc=Damien.LeMoal@wdc.com \
    --cc=agruenba@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).