From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gordan Bobic Subject: Disk Emulation and Trim Instruction Date: Thu, 13 Aug 2009 23:11:36 +0100 Message-ID: <4A848F98.8010308@bobich.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from 78-86-195-86.zone2.bethere.co.uk ([78.86.195.86]:49216 "EHLO sentinel1.shatteredsilicon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752716AbZHMWWE (ORCPT ); Thu, 13 Aug 2009 18:22:04 -0400 Received: from ariia.shatteredsilicon.net (unknown [10.2.3.1]) by sentinel1.shatteredsilicon.net (Postfix) with ESMTP id CCAEBF87C5 for ; Thu, 13 Aug 2009 23:11:36 +0100 (BST) Sender: kvm-owner@vger.kernel.org List-ID: With the recent talk of the trim SATA instruction becoming supported in the upcoming versions of Windows and claims from Intel that support for it in their SSDs is imminent, it occurs to me that this would be equally useful in virtual disk emulation. Since the disk image is a sparse file, it always only grows, and eventually it will grow to it's full intended size even if the actual used space is a small fraction of the container size. Since the trim instruction tells the disk that a particular block is no longer used (and can thus be scheduled for erasing as and when required), the same thing could be used to reclaim space used by sparse files backing the VM. It would allow for higher overcommit of disk usage on VM farms. Is this feature likely to be available in KVM soon? Gordan