Poor performance using discard
Christoph Hellwig
hch at infradead.org
Thu Mar 1 00:31:13 CST 2012
On Thu, Mar 01, 2012 at 05:27:09PM +1100, Dave Chinner wrote:
> One other thing the ext4 tracing implementation does is merge
> adjacent ranges, whereas the XFS implementation does not. XFS has
> more tracking complexity than ext4, though, in that it tracks free
> extents in multiple concurrent journal commits whereas ext4 only has
> to track across a single journal commit. Hence ext4 can merge
> without having to care about where the adjacent range is being
> committed in the same journal checkpoint.
>
> Further, ext4 doesn't reallocate from the freed extents until after
> the journal commit completes, whilst XFS can reallocate freed ranges
> before the freeing is journalled and hence can modify ranges in the
> free list prior to journal commit.
>
> We could probably implement extent merging in the free extent
> tracking similar to ext4, but I'm not sure how much it would gain us
> because of the way we do reallocation of freed ranges prior to
> journal commit....
Also there generally aren't that many merging opportunities. Back when
I implemented the code and looked at block traces we'd get them
occasionally:
(a) for inode buffers due to the inode clusters beeing smaller than the
inode chunks. Better fixed by increasing the amount of inode
clustering we do.
(b) during rm -rf sometimes when lots of small files were end-to-end,
but this doesn't happen all that often.
More information about the xfs
mailing list