From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: don't allocate an ioend for direct I/O completions
Date: Mon, 2 Feb 2015 10:04:03 +1100 [thread overview]
Message-ID: <20150201230403.GD4251@dastard> (raw)
In-Reply-To: <20150130144223.GA27441@laptop.bfoster>
On Fri, Jan 30, 2015 at 09:42:23AM -0500, Brian Foster wrote:
> On Wed, Jan 28, 2015 at 11:54:21PM +0100, Christoph Hellwig wrote:
> > Back in the days when the direct I/O ->end_io callback could be called
> > from interrupt context for AIO we needed a structure to hand off to the
> > workqueue, and reused the ioend structure for this purpose. These days
> > ->end_io is always called from user or workqueue context, which allows us
> > to avoid this memory allocation and simplify the code significantly.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > ---
>
> Looks mostly Ok to me. In fact, with xfs_finish_ioend_sync() calling
> xfs_end_io() directly, I don't see how we currently get into the wq at
> all. Anyways, a few notes...
I've pulled this in after making the couple of minor changes that
Brian suggested....
> > @@ -1507,39 +1514,17 @@ xfs_vm_direct_IO(
> > {
> > struct inode *inode = iocb->ki_filp->f_mapping->host;
> > struct block_device *bdev = xfs_find_bdev_for_inode(inode);
> > - struct xfs_ioend *ioend = NULL;
> > - ssize_t ret;
> >
> > if (rw & WRITE) {
>
> A nit, but I guess you could kill the braces here now too.
Given it's a multi-line return statement, the braces are fine. FWIW,
when we have a if () { return ...} else { return ... } we normally
kill the else. i.e:
if (rw & WRITE) {
return foo(
bar,
baz);
}
return .....;
So I modified it like this.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-02-01 23:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-28 22:54 [PATCH] xfs: don't allocate an ioend for direct I/O completions Christoph Hellwig
2015-01-30 14:42 ` Brian Foster
2015-02-01 23:04 ` Dave Chinner [this message]
2015-02-02 7:27 ` Christoph Hellwig
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=20150201230403.GD4251@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=hch@lst.de \
--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