From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49453 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ou41R-0000eo-Q8 for qemu-devel@nongnu.org; Fri, 10 Sep 2010 09:52:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ou41P-0007mo-SE for qemu-devel@nongnu.org; Fri, 10 Sep 2010 09:52:09 -0400 Received: from verein.lst.de ([213.95.11.210]:51956) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ou41P-0007mh-GN for qemu-devel@nongnu.org; Fri, 10 Sep 2010 09:52:07 -0400 Date: Fri, 10 Sep 2010 15:52:03 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] [RFC] qed: Add QEMU Enhanced Disk format Message-ID: <20100910135202.GC28831@lst.de> References: <4C874812.9090807@redhat.com> <4C87860A.3060904@codemonkey.ws> <4C888287.8020209@redhat.com> <4C88D7CC.5000806@codemonkey.ws> <4C8A1311.8070903@redhat.com> <4C8A20B8.1040800@redhat.com> <4C8A28C5.9010704@redhat.com> <4C8A3509.6060101@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C8A3509.6060101@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org, Avi Kivity , Stefan Hajnoczi On Fri, Sep 10, 2010 at 08:39:21AM -0500, Anthony Liguori wrote: > You're hand waving to a dangerous degree here :-) > > TRIM in qcow2 would require the following sequence: > > 1) remove cluster from L2 table > 2) sync() > 3) reduce cluster reference count > 4) sync() > > TRIM needs to be fast so this is not going to be acceptable. How do you > solve it? It's utterly slow in any real life SSD. > For QED, TRIM requires: > > 1) remove cluster from L2 table > 2) sync() > > In both cases, I'm assuming we lazily write the free list and have a way > to detect unclean mounts. Unclean mounts require an fsck() and both > qcow2 and qed require it. If you do proper transactional metadata updates you can completely drop the sync. TRIM / SCSI unmap are optimizations that can just be noops without compromising data integrity.