qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marc Bevand <m.bevand@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Using the ATA "trim" command to discard sectors in disk images
Date: Mon, 23 Mar 2009 23:14:20 -0700	[thread overview]
Message-ID: <aaccfcb60903232314p200e5416w6d338547cc38f4be@mail.gmail.com> (raw)

The ATA command "trim", recently standardized by the T13 committee, has been
designed to allow SSDs to do better wear-leveling. But there is an obvious fit
for it in virtualizers such as Qemu: guests issuing trim commands would allow
the host to deallocate block sectors in disk images.

In fact the trim command is already used by very recent Linux kernels: it is
exported to the kernel via the block layer blkdev_issue_discard() call, and
to userspace via the BLKDISCARD ioctl:

  http://lwn.net/Articles/293658/

Swap allocation just started making use of it 2.6.29:

  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7992fde72ce06c73280a1939b7a1e903bc95ef85

I just wanted to raise awareness of that command. I hope sometime
in the future we will see qcow files able to decrease in size when files
are deleted in guests :-)

-marc

                 reply	other threads:[~2009-03-24  6:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=aaccfcb60903232314p200e5416w6d338547cc38f4be@mail.gmail.com \
    --to=m.bevand@gmail.com \
    --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).