From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHVYw-0001CU-Je for qemu-devel@nongnu.org; Mon, 18 Mar 2013 04:37:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHVYv-00088u-8S for qemu-devel@nongnu.org; Mon, 18 Mar 2013 04:36:58 -0400 Received: from mail-bk0-x233.google.com ([2a00:1450:4008:c01::233]:51560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHVYu-00088c-VG for qemu-devel@nongnu.org; Mon, 18 Mar 2013 04:36:57 -0400 Received: by mail-bk0-f51.google.com with SMTP id ik5so2375788bkc.38 for ; Mon, 18 Mar 2013 01:36:56 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5146D223.7020501@redhat.com> Date: Mon, 18 Mar 2013 09:36:51 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1363553880.35864.YahooMailNeo@web120802.mail.ne1.yahoo.com> In-Reply-To: <1363553880.35864.YahooMailNeo@web120802.mail.ne1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] SSD Trim Support- Current State? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: d hee Cc: "qemu-devel@nongnu.org" Il 17/03/2013 21:58, d hee ha scritto: > What is the current state of SSD Trim/Discard support for a Qemu/KVM > guests? > > I run a Qemi/ KVM host wtih these kvm guests...they are all Linux os's > and use raw images: 1) 20 gig Linux web-server 2) Subsonic music > streaming server for my Android phone 3) Postfix server for automated > emails 4) Linux guest for sandbox for testing. All of this is on my on > personal system as a hobby and not a a business "production" system. If > I run them off a ssd drive without the trim support, will I see > performance impacted as the guest blocks slowly fill up without being > marked for reuse? DISCARD is finally supported in qemu.git. It is experimental in all released versions. To get trim support you need to do all of the following: 2) use virtio-scsi or another SCSI HBA (IDE would work too, but it is slow); 2) compile qemu.git from master and add ",discard=on" to the "-drive" option; or for released versions add ",discard_granularity=4096" to the "-device" options for disks. For more informations on "-drive" and "-device" check out the docs/qdev-device-use.txt file. 3) mount the filesystems with the discard option in the guest, or periodically run fstrim in the guest; 4) either run the images directly from a partition or logical volume, or mount the filesystems with the discard option in the host, or periodically run fstrim in the host. Paolo