qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Using the ATA "trim" command to discard sectors in disk ima


From: Marc Bevand
Subject: [Qemu-devel] Using the ATA "trim" command to discard sectors in disk images
Date: Mon, 23 Mar 2009 23:14:20 -0700

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 via email to

[Prev in Thread] Current Thread [Next in Thread]