qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: Teng-Feng Yang <shinrairis@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd
Date: Wed, 08 Jan 2014 23:45:39 +0100	[thread overview]
Message-ID: <52CDD513.80408@redhat.com> (raw)
In-Reply-To: <20140108222435.GO4802@redhat.com>

Il 08/01/2014 23:24, Richard W.M. Jones ha scritto:
> On Wed, Jan 08, 2014 at 11:11:35PM +0100, Paolo Bonzini wrote:
>> Is guestfish using "discard=on"?
> 
> No.
> 
> Adding the discard=on parameter does indeed fix this:
> 
> 13M    /tmp/test1
> 17M    /tmp/test2
> 
> However why isn't this the default?  Is there a case where discard=on
> would be undesirable?

It is always safe if supported.  However, it may cause performance
problems, because discarding data from images may make them fragmented,
or cause files to have a lot of extents.  Similarly for block devices
backed by some kind of thin-provisioning NAS (instead it should always
be okay for SSDs).

Unfortunately neither Linux nor the block devices really provide the
information you need to know whether discard can cause these problems.

> It's extremely difficult to know when it's safe to add this parameter.
> Qemu gives no indication of when using discard=.. is safe (ie. won't
> cause qemu to fail to start up or fail in some other way).  It's even
> worse when we have to go via libvirt which itself doesn't expose
> qemu's capabilities upwards.

It is a bug that "-help" doesn't list discard=on, but QMP
query-command-line-options lists it correctly.

libvirt could safely ignore discard if the underlying QEMU does not
support it, but that's not how it was implemented.  Currently,
explicitly specifying either discard='on' and discard='off' will cause
the VM to fail to start if QEMU does not support it.  There are
tradeoffs in both solutions...

Paolo

  reply	other threads:[~2014-01-08 22:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-30 11:58 [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd Teng-Feng Yang
2014-01-02 16:15 ` Richard W.M. Jones
2014-01-07 14:48   ` Paolo Bonzini
2014-01-07 20:27     ` Richard W.M. Jones
2014-01-07 20:48       ` Paolo Bonzini
2014-01-07 21:22         ` Richard W.M. Jones
2014-01-08 22:11           ` Paolo Bonzini
2014-01-08 22:24             ` Richard W.M. Jones
2014-01-08 22:45               ` Paolo Bonzini [this message]
2014-01-08 22:53                 ` Richard W.M. Jones
2014-01-09  7:02                   ` Paolo Bonzini
2014-01-07 21:27         ` Richard W.M. Jones
2014-01-06  2:45 ` Stefan Hajnoczi

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=52CDD513.80408@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    --cc=shinrairis@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 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).