From: Christoph Hellwig <hch@infradead.org>
To: Ming Lei <ming.lei@canonical.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-kernel@vger.kernel.org,
Dave Kleikamp <dave.kleikamp@oracle.com>,
Zach Brown <zab@zabbo.net>, Christoph Hellwig <hch@infradead.org>,
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>,
linux-api@vger.kernel.org
Subject: Re: [PATCH v8 4/6] block: loop: prepare for supporing direct IO
Date: Thu, 30 Jul 2015 08:09:00 -0700 [thread overview]
Message-ID: <20150730150900.GA13082@infradead.org> (raw)
In-Reply-To: <1438256184-23645-5-git-send-email-ming.lei@canonical.com>
On Thu, Jul 30, 2015 at 07:36:22AM -0400, Ming Lei wrote:
> This patches provides one interface for enabling direct IO
> from user space:
>
> - userspace(such as losetup) can pass 'file' which is
> opened/fcntl as O_DIRECT
>
> Also __loop_update_dio() is introduced to check if direct I/O
> can be used on current loop setting.
>
> The last big change is to introduce LO_FLAGS_DIRECT_IO flag
> for userspace to know if direct IO is used to access backing
> file.
Maybe i'm missing something because I was too busy to follow the
current discussion, but this still doesn't check that the loop
device sector size is aligned to the sector size of the underlying
filesystem.
E.g. with this you could create a loop device with a 512 byte
sector size on a filesystem with 4k sector size, and it would attempt
to use direct I/O and fail.
> + unsigned dio_align = inode->i_sb->s_bdev ?
> + (bdev_io_min(inode->i_sb->s_bdev) - 1) : 0;
> +
> + /*
> + * We support direct I/O only if lo_offset is aligned
> + * with the min I/O size of backing device.
> + *
> + * Request's offset and size will be checked in I/O path.
> + */
> + if (dio) {
> + if (!dio_align || (lo->lo_offset & dio_align))
> + use_dio = false;
Also this means you'll never use direct I/O on network filesystems,
which really would benefit from it.
next prev parent reply other threads:[~2015-07-30 15:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-30 11:36 [PATCH v8 0/6] block: loop: improve loop with AIO Ming Lei
2015-07-30 11:36 ` [PATCH v8 1/6] fs: direct-io: don't dirtying pages for ITER_BVEC/ITER_KVEC direct read Ming Lei
2015-07-30 11:36 ` [PATCH v8 2/6] block: loop: set QUEUE_FLAG_NOMERGES for request queue of loop Ming Lei
2015-07-30 11:36 ` [PATCH v8 3/6] block: loop: use kthread_work Ming Lei
2015-07-30 11:36 ` [PATCH v8 4/6] block: loop: prepare for supporing direct IO Ming Lei
2015-07-30 15:09 ` Christoph Hellwig [this message]
2015-07-30 15:21 ` Ming Lei
2015-07-30 15:30 ` Dave Kleikamp
2015-07-30 15:45 ` Ming Lei
2015-07-30 11:36 ` [PATCH v8 5/6] block: loop: introduce ioctl command of LOOP_SET_DIRECT_IO Ming Lei
2015-07-30 11:36 ` [PATCH v8 6/6] block: loop: support DIO & AIO Ming Lei
2015-07-30 16:42 ` Christoph Hellwig
2015-07-31 3:13 ` 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=20150730150900.GA13082@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-api@vger.kernel.org \
--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