From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WORWy-0003Iw-VP for qemu-devel@nongnu.org; Fri, 14 Mar 2014 08:48:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WORWt-0005fz-0G for qemu-devel@nongnu.org; Fri, 14 Mar 2014 08:48:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WORWs-0005ft-O3 for qemu-devel@nongnu.org; Fri, 14 Mar 2014 08:48:02 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2ECm2AG018158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Mar 2014 08:48:02 -0400 Message-ID: <5322FA7F.3030802@redhat.com> Date: Fri, 14 Mar 2014 13:47:59 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20140313214814.GC1985@redhat.com> <5322F670.50906@redhat.com> <20140314124216.GQ1346@redhat.com> In-Reply-To: <20140314124216.GQ1346@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" Cc: qemu-devel@nongnu.org Il 14/03/2014 13:42, Richard W.M. Jones ha scritto: > I worked around this in any case by rearranging the test [2]: > > Doing: > > rm /a_big_file > fstrim / > sync > umount / > [shut down qemu] > > would only trim 64 KB on the host. > > Doing: > > rm /a_big_file > umount / # added > mount -o nodiscard /dev/sda / # added > fstrim / > sync > umount / > [shut down qemu] > > would trim the expected amount (around 10 MB). > > I've no idea why this is (looks like an ext4/kernel bug to me), but in > any case the tests now use the second method[2]. Could be a race condition (something going on in the background between rm and fstrim). Try syncing before fstrim, not after. In fact the sync before umount should not be necessary. Paolo