All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: fio@vger.kernel.org, Asias He <asias@redhat.com>
Subject: Re: Why does 'direct' influence 'fsync'?
Date: Sat, 26 Jan 2013 18:37:12 -0700	[thread overview]
Message-ID: <20130127013712.GJ15635@kernel.dk> (raw)
In-Reply-To: <CAJSP0QURHyhFGc3ZVo=TM16_VUY-pRqNMTOJcNwNGUoJCdoi0Q@mail.gmail.com>

On Sat, Jan 26 2013, Stefan Hajnoczi wrote:
> On Sat, Jan 26, 2013 at 5:28 PM, Jens Axboe <axboe@kernel.dk> wrote:
> > On Fri, Jan 25 2013, Stefan Hajnoczi wrote:
> >> Is there a way to flush the disk write cache when O_DIRECT is in use?
> >>
> >> It seems that direct=1 causes the fsync setting to be ignored.  Asias
> >> writes:
> >>
> >> > The O_DIRECT do affect the flush behaviour. e.g
> >> >
> >> > guest$ fio --fsync=100 --direct=1
> >> > No virtio_blk_handle_flush is observed on host side every 100 IOs
> >> >
> >> > guest$ fio --fsync=100 --direct=0
> >> > virtio_blk_handle_flush is observed on host side every 100 IOs
> >>
> >> Am I missing a reason for this behavior?  To me it seems weird since you
> >> could already use --fsync=0 --direct=1 if you want to guarantee that
> >> fsync is not called.  I don't see a need to override the fsync setting.
> >
> > You are right, fio should not be double guessing options like that. If
> > you ask for fsync, you should get fsync.
> >
> > Does the below work for you?
> 
> Yes, thanks!
> 
> Tested-by: Stefan Hajnoczi <stefanha@redhat.com>

Great, thanks for reporting and testing!

-- 
Jens Axboe


      reply	other threads:[~2013-01-27  1:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-25 11:42 Why does 'direct' influence 'fsync'? Stefan Hajnoczi
2013-01-26 16:28 ` Jens Axboe
2013-01-26 16:51   ` Stefan Hajnoczi
2013-01-27  1:37     ` Jens Axboe [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=20130127013712.GJ15635@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asias@redhat.com \
    --cc=fio@vger.kernel.org \
    --cc=stefanha@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.