public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Brian Foster <bfoster@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, xfs@oss.sgi.com
Subject: Re: [PATCH 3/3] xfs: optimize bio handling in the buffer writeback path
Date: Fri, 11 Mar 2016 15:55:09 +0100	[thread overview]
Message-ID: <20160311145509.GB2551@lst.de> (raw)
In-Reply-To: <20160303151730.GC57990@bfoster.bfoster>

On Thu, Mar 03, 2016 at 10:17:30AM -0500, Brian Foster wrote:
> > +
> > +		/*
> > +		 * For the last bio, bi_private points to the ioend, so we
> > +		 * need to explicitly end the iteration here.
> > +		 */
> 
> Do you mean the last bio is pointed to by the ioend?

No, bio->bi_private of the last bio points to the ioend.

> > @@ -541,10 +457,8 @@ xfs_submit_ioend(
> >  	 * at this point in time.
> >  	 */
> >  error_finish:
> > -	if (ioend->io_bio)
> > -		bio_put(ioend->io_bio);
> > -	ioend->io_error = status;
> > -	xfs_finish_ioend(ioend);
> > +	ioend->io_bio->bi_error = status;
> > +	bio_endio(ioend->io_bio);
> >  	return status;
> 
> bi_end_io is not set here, so what happens to the buffers added to the
> ioend in this case?

We're not calling the end_io function we should be, good catch and fixed.

> Trailing whitespace on the above line.

Ok, fixed.

> And FWIW, I'm not a huge fan of
> open coding both the bio and ioend allocations. It makes it easier to
> distinguish the higher level algorithm from all of the structure
> initialization noise. It looks to me that alloc_ioend() could remain
> mostly as is, using the new bioset allocation, and alloc_ioend_bio()
> could be inlined and renamed to something like init_bio_from_bh() or
> some such.

Hmm, not a huge fan of these single use function in general, but
I'll see if I can do something sensible.

> I'm trying to make sure I grok how this works without knowing much about
> the block layer. So we chain the current bio to the new one, the latter
> becoming the parent, and submit the old one. It looks to me that this
> could result in bio_endio() on the parent, which seems fishy... what am
> I missing? IOW, is it safe to submit bios like this before the entire
> chain is created?

Ignoring this for now and jumping to the next reply..

> > + out_free_ioend_bioset:
> > + 	bioset_free(xfs_ioend_bioset);
> 
> Space before tab ^.

Fixed.

> > + 	bioset_free(xfs_ioend_bioset);
> 
> Space before tab ^.

Fixed.

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

  parent reply	other threads:[~2016-03-11 14:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24  8:20 futher writeback updates Christoph Hellwig
2016-02-24  8:20 ` [PATCH 1/3] xfs: build bios directly in xfs_add_to_ioend Christoph Hellwig
2016-03-03 15:17   ` Brian Foster
2016-02-24  8:20 ` [PATCH 2/3] xfs: don't release bios on completion immediately Christoph Hellwig
2016-03-03 15:17   ` Brian Foster
2016-03-11 14:47     ` Christoph Hellwig
2016-03-11 17:52       ` Brian Foster
2016-02-24  8:20 ` [PATCH 3/3] xfs: optimize bio handling in the buffer writeback path Christoph Hellwig
2016-03-03 15:17   ` Brian Foster
2016-03-04 13:38     ` Brian Foster
2016-03-11 15:06       ` Christoph Hellwig
2016-03-11 14:55     ` Christoph Hellwig [this message]
2016-03-01 13:01 ` futher writeback updates Christoph Hellwig
2016-03-01 21:42   ` Dave Chinner
  -- strict thread matches above, loose matches on Subject: below --
2016-03-16 11:44 further writeback updates V2 Christoph Hellwig
2016-03-16 11:44 ` [PATCH 3/3] xfs: optimize bio handling in the buffer writeback path Christoph Hellwig
2016-03-17 13:05   ` Brian Foster
2016-05-31 15:35   ` Eric Sandeen
2016-05-31 16:31     ` Christoph Hellwig
2016-05-31 16:44       ` Eric Sandeen
2016-05-31 17:35         ` Eric Sandeen

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=20160311145509.GB2551@lst.de \
    --to=hch@lst.de \
    --cc=bfoster@redhat.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