From: Christoph Hellwig <hch@infradead.org>
To: Ming Lei <ming.lei@canonical.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Jens Axboe <axboe@kernel.dk>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Dave Kleikamp <dave.kleikamp@oracle.com>,
Zach Brown <zab@zabbo.net>,
Maxim Patlasov <mpatlasov@parallels.com>,
Andrew Morton <akpm@linux-foundation.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Tejun Heo <tj@kernel.org>, Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH v9 6/6] block: loop: support DIO & AIO
Date: Sat, 8 Aug 2015 23:44:39 -0700 [thread overview]
Message-ID: <20150809064439.GC2436@infradead.org> (raw)
In-Reply-To: <CACVXFVOyVi8hyxU5yv=heSy2SpjGAY9MKi3kow_gweFn8_tL-A@mail.gmail.com>
On Fri, Aug 07, 2015 at 04:25:52AM -0400, Ming Lei wrote:
> On Fri, Aug 7, 2015 at 3:43 AM, Christoph Hellwig <hch@infradead.org> wrote:
> > I really disagree with the per-cmd use_dio tracking.
>
> Could you explain it in a bit?
>
> >
> > If we know at setup time that the loop device sector size is smaller
> > than the sector size of the underlying device we should never allow
> > dio, and othewise it should always work for data.
>
> Yes, that is just what I did in v7, and we can only do dio in case
> of 512 byte sector size of backing device(not considering the
> following patches from Hannes).
>
> When sector size of backing device isn't 512, most of transfer(buffered I/O
> and normal dio) is still 4k aligned, that is why I suggest to use per-cmd
> use_dio tracking.
>
> The patch avoids the race between buffered io and dio, doesn't it?
> The introduced cost is trivial and most of times it needn't to wait for
> completion of pending dio.
All block filesystems can do direct I/O on a _sector size_, not
_block size_ boundary, e.g. for the typical setup of a 4k block size
xfs/btrfs/ext4 file system on a 512 byte sector device you can do 512
byte aligned direct I/O.
> > is no need for draining or mode checking for an fsync - FLUSH is always
> > only guranteed to flush out I/O that has completed by the time it's
> > issued.
>
> Could you point it out in the patch?
Basically your lo_drain_pending_dio() functionality is not needed.
next prev parent reply other threads:[~2015-08-09 6:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-06 8:42 [PATCH v9 0/6] block: loop: improve loop with AIO Ming Lei
2015-08-06 8:42 ` [PATCH v9 1/6] fs: direct-io: don't dirtying pages for ITER_BVEC/ITER_KVEC direct read Ming Lei
2015-08-06 8:42 ` [PATCH v9 2/6] block: loop: set QUEUE_FLAG_NOMERGES for request queue of loop Ming Lei
2015-08-06 8:42 ` [PATCH v9 3/6] block: loop: use kthread_work Ming Lei
2015-08-06 8:42 ` [PATCH v9 4/6] block: loop: prepare for supporing direct IO Ming Lei
2015-08-06 8:42 ` [PATCH v9 5/6] block: loop: introduce ioctl command of LOOP_SET_DIRECT_IO Ming Lei
2015-08-06 8:42 ` [PATCH v9 6/6] block: loop: support DIO & AIO Ming Lei
2015-08-07 7:43 ` Christoph Hellwig
2015-08-07 8:25 ` Ming Lei
2015-08-09 6:44 ` Christoph Hellwig [this message]
2015-08-09 13:04 ` Ming Lei
2015-08-09 13:44 ` Christoph Hellwig
2015-08-09 14:27 ` Ming Lei
2015-08-09 23:41 ` Dave Chinner
2015-08-10 2:50 ` Ming Lei
2015-08-10 8:08 ` Christoph Hellwig
2015-08-10 14:33 ` Ming Lei
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=20150809064439.GC2436@infradead.org \
--to=hch@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=dave.kleikamp@oracle.com \
--cc=david@fromorbit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@canonical.com \
--cc=mpatlasov@parallels.com \
--cc=tj@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=zab@zabbo.net \
/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