qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] fstrim & upstream kernel not working


From: Paolo Bonzini
Subject: Re: [Qemu-devel] fstrim & upstream kernel not working
Date: Fri, 14 Mar 2014 13:47:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

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   



reply via email to

[Prev in Thread] Current Thread [Next in Thread]