qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] qed: Add QEMU Enhanced Disk format


From: Anthony Liguori
Subject: Re: [Qemu-devel] [RFC] qed: Add QEMU Enhanced Disk format
Date: Fri, 10 Sep 2010 08:22:14 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Lightning/1.0b1 Thunderbird/3.0.6

On 09/10/2010 06:43 AM, Avi Kivity wrote:
 On 09/10/2010 02:33 PM, Stefan Hajnoczi wrote:

btw, despite being not properly designed, qcow2 is able to support TRIM. qed isn't able to, except by leaking clusters on shutdown. TRIM support is required unless you're okay with the image growing until it is no longer
sparse (the lack of TRIM support in guests make sparse image formats
somewhat of a joke, but nobody seems to notice).
Anthony has started writing up notes on trim for qed:
http://wiki.qemu.org/Features/QED/Trim


Looks like it depends on fsck, which is not a good idea for large images.

fsck will always be fast on qed because the metadata is small. For a 1PB image, there's 128MB worth of L2s if it's fully allocated (keeping in mind, that once you're fully allocated, you'll never fsck again). If you've got 1PB worth of storage, I'm fairly sure you're going to be able to do 128MB of reads in a short period of time. Even if it's a few seconds, it only occurs on power failure so it's pretty reasonable.

I need to look at the actual ATA and SCSI specs for how this will
work.  The issue I am concerned with is sub-cluster trim operations.
If the trim region is less than a cluster, then both qed and qcow2
don't really have a way to handle it.  Perhaps we could punch a hole
in the file, given a userspace interface to do this, but that isn't
ideal because we're losing sparseness again.

To deal with a sub-cluster TRIM, look at the surrounding sectors. If they're zero, free the cluster. If not, write zeros or use sys_punch() to the range specified by TRIM.

Better yet, if you can't trim a full cluster, just write out zeros and have a separate background process that punches out zero clusters.

That approach is a bit more generic and will help compact images independently of guest trims.

Regards,

Anthony Liguori




reply via email to

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