Skip to content

RFC xfs: basic cow fork speculative preallocation

Brian Foster linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4xfs: clean up cow fork reservation and tag inodes correctlyfs/xfs/xfs_reflink.c+4 -244 replies
2/4xfs: logically separate iomap range from allocation rangefs/xfs/xfs_iomap.c+11 -82 replies
3/4xfs: reuse xfs_file_iomap_begin_delay() for cow fork delallocfs/xfs/xfs_iomap.c+58 -214 replies
4/4xfs: implement basic COW fork speculative preallocationfs/xfs/xfs_iomap.c+45 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC 0/4] xfs: basic cow fork speculative preallocation

Hi all,

This is an experiment based on an idea for COW fork speculative preallocation. This is experimental, lightly/barely tested and sent in RFC form to solicit thoughts, ideas or flames before I spend time taking it further.

Patch 1 probably stands on its own. Patches 2 and 3 are some refactoring and patch 4 implements the basic idea, which is described in the commit log description. The testing I've done so far is basically similar to how one would test the effects of traditional speculative preallocation:
write to multiple reflinked files in parallel and examine the resulting fragmentation. Specifically, I wrote sequentially to 16 different reflinked files of the same 8GB original (which has two data extents, completely shared). Without preallocation, the test results in ~248 extents across the 16 files. With preallocation, the test results in 32 extents across the 16 files (i.e., 2 extents per file, same as the source file).

An obvious tradeoff is the unnecessarily aggressive allocation that might occur in the event of random writes to a large file (such as in the cloned VM disk image use case), but my thinking is that the cowblocks tagging and reclaim infrastructure should manage that sufficiently (lack of testing notwithstanding). In any event, I'm interested in any thoughts along the lines of whether this is useful at all, alternative algorithm ideas, etc.

Brian

Brian Foster (4):
xfs: clean up cow fork reservation and tag inodes correctly
xfs: logically separate iomap range from allocation range
xfs: reuse xfs_file_iomap_begin_delay() for cow fork delalloc
xfs: implement basic COW fork speculative preallocation

 fs/xfs/xfs_iomap.c   | 132 +++++++++++++++++++++++++++++++++++++++++----------
 fs/xfs/xfs_reflink.c |  28 ++---------
 2 files changed, 111 insertions(+), 49 deletions(-)
Signature · 1 line
2.7.4