lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 12 Mar 2014 10:17:44 +0000
From:	"Richard W.M. Jones" <rjones@...hat.com>
To:	Eric Sandeen <sandeen@...hat.com>, pbonzini@...hat.com
Cc:	linux-ext4@...r.kernel.org
Subject: Re: fstrim has no effect on a just-mounted filesystem

On Tue, Mar 11, 2014 at 11:30:47PM +0000, Richard W.M. Jones wrote:
> On Tue, Mar 11, 2014 at 06:09:28PM -0500, Eric Sandeen wrote:
> > On Tue, Mar 11, 2014, Richard W.M. Jones wrote:
> > > However just the act of doing the tracing *caused* the trim to happen
> > > properly in the underlying disk.
> > 
> > that sounds very strange...
> 
> Thanks Eric.
> 
> FYI the libguestfs / virt-sparsify patch series that motivates this is
> here:
> 
> https://www.redhat.com/archives/libguestfs/2014-March/thread.html#00091
> 
> Even with the greatly reduced set of traces (see attached), just the
> act of tracing seems to have made trimming work properly.  The output
> file has been trimmed properly from 926 MB to 819 MB:

I did a bit more testing on this.

It appears we are sure that the ext4 ioctl FITRIM is sending discard
requests.

However fstrim doesn't happen reliably.

  fstrim + blktrace       works reliably
  fstrim + fsync          unreliable, usually fails to trim
  fstrim + sync           unreliable, usually fails to trim
  fstrim + umount         unreliable, usually fails to trim
  fstrim + sleep 10       unreliable, usually fails to trim
  ( fstrim + sleep 10 ) x 3  unreliable, usually fails to trim
  fstrim on its own       unreliable, usually fails to trim

Somewhere, the discard requests are disappearing in the stack (or more
likely, being delayed).  blktrace/trace-cmd somehow forces them out.
But fsync/sync/umount/sleep does not.  They might be stuck in qemu too ...

Is there any further test I can try here?

Is there a way to force out discard requests?

qemu cache mode is set to writeback.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top

Download attachment "test-fstrim.pl" of type "application/x-perl" (3682 bytes)

Powered by blists - more mailing lists