]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: measure all contiguous previous extents for prealloc size
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 23 May 2020 16:43:30 +0000 (09:43 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 27 May 2020 15:49:28 +0000 (08:49 -0700)
commit1d39d33bcfc5d23652011e2c6158ee6cb9372761
tree8dcb618764dfec7bcb0a0a2596cd9568aa0922ba
parent764b7cffd398d0dfea1f1bfa6d52efdcf363221e
xfs: measure all contiguous previous extents for prealloc size

When we're estimating a new speculative preallocation length for an
extending write, we should walk backwards through the extent list to
determine the number of number of blocks that are physically and
logically contiguous with the write offset, and use that as an input to
the preallocation size computation.

This way, preallocation length is truly measured by the effectiveness of
the allocator in giving us contiguous allocations without being
influenced by the state of a given extent.  This fixes both the problem
where ZERO_RANGE within an EOF can reduce preallocation, and prevents
the unnecessary shrinkage of preallocation when delalloc extents are
turned into unwritten extents.

This was found as a regression in xfs/014 after changing delalloc writes
to create unwritten extents during writeback.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/xfs_iomap.c