From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WORGF-0002NY-By for qemu-devel@nongnu.org; Fri, 14 Mar 2014 08:30:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WORG9-0000fo-Cr for qemu-devel@nongnu.org; Fri, 14 Mar 2014 08:30:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WORG9-0000fg-4p for qemu-devel@nongnu.org; Fri, 14 Mar 2014 08:30:45 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2ECUhVH001813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Mar 2014 08:30:44 -0400 Message-ID: <5322F670.50906@redhat.com> Date: Fri, 14 Mar 2014 13:30:40 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20140313214814.GC1985@redhat.com> In-Reply-To: <20140313214814.GC1985@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] fstrim & upstream kernel not working List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" , qemu-devel@nongnu.org Il 13/03/2014 22:49, Richard W.M. Jones ha scritto: > I got fstrim happily working in Fedora 20, but it's not working with > the upstream kernel. The message is: > > fstrim -v /sysroot/ > [ 45.541339] sda: WRITE SAME failed. Manually zeroing. > /sysroot/: 47.2 MiB (49466368 bytes) trimmed > > While this isn't technically an error, it of course doesn't trim > anything. In fact the host disk grows after the fstrim. > > A couple of questions: > > - Is there any reason why virtio-scsi doesn't emulate WRITE SAME? Yes, the reason is that you're using QEMU 1.7. :) > - Can you see where ext4 issues the zeroout/write same call? AFAICT > it is still issuing discards, but these are getting turned into > zeroout/write same by some sort of block layer magic that I can't > quite follow. That's provisioning_mode, which is writesame_16 with QEMU 1.7 and unmap with QEMU 2.0. Paolo > kernel: 3.14.0-0.rc6.git2.1.fc21 > qemu: 1.7.0-5.fc21.x86_64