On 2/28/12 10:08 PM, Dave Chinner wrote:
> Also, I think you need to provide a block trace (output of
> blktrace/blkparse for the rm -rf workloads) for both the XFS and
> ext4 cases so we can see what discards are actually being issued and
> how long they take to complete....
I ran a quick test on a loopback device on 3.3.0-rc4. Loopback supports
discards. I made 1G filesystems on loopback on ext4 & xfs, mounted with
-o discard, cloned a git tree to them, and ran rm -rf; sync under blktrace.
XFS took about 11 seconds, ext4 took about 1.7.
(without trim, times were roughly the same - but discard/trim is probably
quite fast on the looback file)
Both files were reduced in disk usage about the same amount, so online
discard was working for both:
# du -h ext4_fsfile xfs_fsfile
XFS issued many more discards than ext4:
# blkparse xfs.trace | grep -w D | wc -l
# blkparse ext4.trace | grep -w D | wc -l
XFS issued many small discards (4k/8 sectors) and a few larger ones:
[sectors | # discards]
ext4 issued far fewer discards, but in much larger chunks:
So that could certainly explain the relative speed.