From: Christoph Hellwig <hch@infradead.org>
To: Jens Axboe <axboe@fb.com>
Cc: Christoph Hellwig <hch@infradead.org>,
axboe@kernel.dk, linux-block@vger.kernel.org
Subject: Re: [PATCHSET] Add support for simplified async direct-io
Date: Wed, 16 Nov 2016 08:31:47 -0800 [thread overview]
Message-ID: <20161116163147.GA25038@infradead.org> (raw)
In-Reply-To: <f8c29e81-7323-7362-b507-1b7c61e8a19a@fb.com>
On Wed, Nov 16, 2016 at 09:09:17AM -0700, Jens Axboe wrote:
> Another idea - just limit the max we can support in the simplified
> version as a single bio. If the user is requesting more, fall back to
> the old slow path. Doesn't really matter, since the transfer size will
> be large enough to hopefully overcome any deficiencies in the old path.
I really want to kill off the old code :) Maybe we could use my
iomap-based code instead of another block version if we delegate it
far enough away from the host path with a patch like yours, but I really
wonder if avoiding the atomic inc/dec is that important once we are
above a minimal threshold. That being said I think we could avoid
the atomic op for the the single-bio cases even with code that handles
multiples bios. Kent actually noted that on my full blown iomap
version.
But if we need another fast but not super fast case your patch below
looks reasonable. Although we really need to implement O_SYNC/O_DSYNC
support for it to avoid losing data.
> + /*
> + * Overload bio size in error. If it gets set, we lose the
> + * size, but we don't need the size for that case. IO is limited
> + * to BIO_MAX_PAGES, so we can't overflow.
> + */
> + ret = bio->bi_error = bio->bi_iter.bi_size;
Oh, that's a neat trick.
> + if (nr_pages <= DIO_INLINE_BIO_VECS)
> + vecs = inline_vecs;
> + else {
> + vecs = kmalloc(nr_pages * sizeof(struct bio_vec), GFP_KERNEL);
kmalloc_array?
next prev parent reply other threads:[~2016-11-16 16:31 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-14 17:28 [PATCHSET] Add support for simplified async direct-io Jens Axboe
2016-11-14 17:28 ` [PATCH 1/2] block: support any sized IO for simplified bdev direct-io Jens Axboe
2016-11-14 17:28 ` [PATCH 2/2] block: add support for async simple direct-io for bdevs Jens Axboe
2016-11-14 17:37 ` [PATCHSET] Add support for simplified async direct-io Christoph Hellwig
2016-11-14 17:47 ` Jens Axboe
2016-11-14 18:00 ` Christoph Hellwig
2016-11-14 18:02 ` Jens Axboe
2016-11-14 18:05 ` Christoph Hellwig
2016-11-14 18:08 ` Jens Axboe
2016-11-14 18:11 ` Christoph Hellwig
2016-11-14 18:17 ` Jens Axboe
2016-11-15 13:58 ` Christoph Hellwig
2016-11-16 16:09 ` Jens Axboe
2016-11-16 16:31 ` Christoph Hellwig [this message]
2016-11-16 16:57 ` Jens Axboe
2016-11-16 17:16 ` Christoph Hellwig
2016-11-16 20:02 ` Jens Axboe
2016-11-16 20:36 ` Jens Axboe
2016-11-16 20:51 ` Jens Axboe
2016-11-17 3:44 ` Jens Axboe
2016-11-17 4:43 ` Jens Axboe
2016-11-17 12:50 ` Christoph Hellwig
2016-11-17 13:25 ` Jens Axboe
2016-11-17 15:03 ` Jens Axboe
2016-11-17 15:16 ` Christoph Hellwig
2016-11-17 20:17 ` Christoph Hellwig
2016-11-17 20:30 ` Jens Axboe
2016-11-17 21:04 ` Christoph Hellwig
2016-11-17 21:06 ` Jens Axboe
2016-11-17 12:46 ` Christoph Hellwig
2016-11-17 13:26 ` Jens Axboe
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=20161116163147.GA25038@infradead.org \
--to=hch@infradead.org \
--cc=axboe@fb.com \
--cc=axboe@kernel.dk \
--cc=linux-block@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).