qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <Laurent.Vivier@bull.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2 v2] Direct IDE I/O
Date: Mon, 03 Dec 2007 20:00:18 +0100	[thread overview]
Message-ID: <1196708418.5587.10.camel@frecb07144> (raw)
In-Reply-To: <475426C7.20503@codemonkey.ws>

[-- Attachment #1: Type: text/plain, Size: 2480 bytes --]

Le lundi 03 décembre 2007 à 09:54 -0600, Anthony Liguori a écrit :
> Laurent Vivier wrote:
> > Le lundi 03 décembre 2007 à 11:23 +0100, Fabrice Bellard a écrit :
> >   
> >> Laurent Vivier wrote:
> >>     
> >>> This patch enhances the "-drive ,cache=off" mode with IDE drive emulation
> >>> by removing the buffer used in the IDE emulation.
> >>> ---
> >>>  block.c     |   10 +++
> >>>  block.h     |    2 
> >>>  block_int.h |    1 
> >>>  cpu-all.h   |    1 
> >>>  exec.c      |   19 ++++++
> >>>  hw/ide.c    |  176 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
> >>>  vl.c        |    1 
> >>>  7 files changed, 204 insertions(+), 6 deletions(-)
> >>>       
> >> What's the use of keeping the buffered case ?
> >>     
> >
> > Well, I don't like to remove code written by others...
> > and I don't want to break something.
> >
> > But if you think I should remove the buffered case, I can.
> >
> > BTW, do you think I should enable "cache=off" by default ?
> > Or even remove the option from the command line and always use
> > O_DIRECT ?
> >   
> 
> Hi Laurent,

Hi Anthony,

> Have you done any performance testing?  Buffered IO should absolutely 
> beat direct IO simply because buffered IO allows writes to complete 
> before they actually hit disk.  I've observed this myself.  Plus the 
> host typically has a much larger page cache then the guest so the second 
> level of caching helps an awful lot.

I don't have real benchmarks. I just saw some improvements with dbench
(which is not a good benchmark, I know...)

Direct I/O can be good in some cases (because it avoids multiple copies)
and good in others (because it avoids disk access, and as you say it
doesn't wait I/O completion).

But there are at least two other good reasons to use it:

- reliability: by avoiding cache we improve probability of data are on
disk (and the ordering of I/O). And as you say, as we wait write
completion, we are sure data have been written.

- isolation: it allows to avoid to pollute host cache with guest data
(and if we have several guests, it avoids to have performance impact at
the cache level between guests).

But there is no perfect solution, it's why I think it's good thing to
let the choice to the user.

Laurent
- 
-- 
------------- Laurent.Vivier@bull.net  --------------
       "Any sufficiently advanced technology is
  indistinguishable from magic." - Arthur C. Clarke

[-- Attachment #2: Ceci est une partie de message numériquement signée --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2007-12-03 19:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-03 10:09 [Qemu-devel] [PATCH 0/2 v2] Open disk images with O_DIRECT Laurent Vivier
2007-12-03 10:09 ` [Qemu-devel] [PATCH 1/2 v2] Add "cache" parameter to "-drive" Laurent Vivier
2007-12-03 10:09   ` [Qemu-devel] [PATCH 2/2 v2] Direct IDE I/O Laurent Vivier
2007-12-03 10:23     ` Fabrice Bellard
2007-12-03 10:30       ` Laurent Vivier
2007-12-03 11:40         ` Markus Hitter
2007-12-03 15:39           ` Paul Brook
2007-12-03 19:26             ` Samuel Thibault
2007-12-03 15:54         ` Anthony Liguori
2007-12-03 17:08           ` Samuel Thibault
2007-12-03 17:17             ` Paul Brook
2007-12-03 17:49               ` Jamie Lokier
2007-12-03 18:08                 ` Anthony Liguori
2007-12-03 18:40                   ` Jamie Lokier
2007-12-03 18:06             ` Anthony Liguori
2007-12-03 19:10               ` Laurent Vivier
2007-12-03 19:16                 ` Paul Brook
2007-12-03 21:36                   ` Anthony Liguori
2007-12-04 12:49                     ` Gerd Hoffmann
2007-12-04 13:02                       ` Laurent Vivier
2007-12-04  8:13                   ` Laurent Vivier
2007-12-03 21:13                 ` Gerd Hoffmann
2007-12-03 21:23                   ` Samuel Thibault
2007-12-03 21:38                   ` Anthony Liguori
2007-12-04 13:21                     ` Gerd Hoffmann
2007-12-04 15:03                       ` Anthony Liguori
2007-12-04 16:18                         ` Gerd Hoffmann
2007-12-05 14:47                           ` Anthony Liguori
2007-12-03 19:14               ` Paul Brook
2007-12-03 19:00           ` Laurent Vivier [this message]
2007-12-03 11:14       ` Johannes Schindelin

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=1196708418.5587.10.camel@frecb07144 \
    --to=laurent.vivier@bull.net \
    --cc=qemu-devel@nongnu.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).