linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Ilya Lantukh <ilantukh@gridgain.com>
Cc: Christoph Hellwig <hch@infradead.org>, linux-fsdevel@vger.kernel.org
Subject: Re: aio: Question about durability guarantees
Date: Tue, 12 Jul 2016 11:11:58 -0400	[thread overview]
Message-ID: <x49y456sxfl.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <CADM=oMYLg34pnJr5-za0d69X7bMpAXrKGxR3dzhtLk6QSHKjnQ@mail.gmail.com> (Ilya Lantukh's message of "Tue, 12 Jul 2016 16:02:25 +0300")

Ilya Lantukh <ilantukh@gridgain.com> writes:

> On Tue, Jul 12, 2016 at 3:00 PM, Christoph Hellwig <hch@infradead.org> wrote:
>> On Tue, Jul 12, 2016 at 12:42:28PM +0300, Ilya Lantukh wrote:
>>> Hi all,
>>>
>>> We are considering to use libaio in our project as an optional
>>> alternative to Java NIO. Our goal is to improve performance while
>>> maintaining durability.
>>>
>>> We have performed tests on different storage devices. Files were
>>> opened with flags: O_WRONLY | O_DIRECT | O_DSYNC. However, on some SSD
>>> devices O_DSYNC causes io_submit() to block until operation is
>>> finished, which is not acceptable in our case.
>>
>> What is your exact setup?  Sounds like you're using a file system
>> and not a block device node.  Which filesystem shows this behavior?
>
> The filesystem is ext4. Yes, we access file using a file system (like
> fd = open("~/test/file0", ...);) and for most devices it works fine.
> Does it mean that we need to open a block device directly to get full
> advantage of aio?

No.  There are always cases where the I/O submission path can block.  I
find it extremely unusual that you've linked blocking to a particular
type of device, though.  Try running the io_submit.stp systemtap script
to see where you're blocking.

>>> The question is: do libaio writes with only WRONLY | O_DIRECT flags
>>> provide any durability guarantees?
>>
>> No, they don't, you need O_DSYNC for that.
>
> Got it, thanks!

Please have a look at this article for more information:

https://lwn.net/Articles/457667/

Cheers,
Jeff

      reply	other threads:[~2016-07-12 15:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12  9:42 aio: Question about durability guarantees Ilya Lantukh
2016-07-12 12:00 ` Christoph Hellwig
2016-07-12 13:02   ` Ilya Lantukh
2016-07-12 15:11     ` Jeff Moyer [this message]

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=x49y456sxfl.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=hch@infradead.org \
    --cc=ilantukh@gridgain.com \
    --cc=linux-fsdevel@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).