On Sat, Sep 24, 2016 at 12:42:34PM -0700, Christoph Hellwig wrote: > On Thu, Aug 25, 2016 at 04:38:14PM -0700, Darrick J. Wong wrote: > > Trim CoW reservations made on behalf of a cowextsz hint if they get too > > old or we run low on quota, so long as we don't have dirty data awaiting > > writeback or directio operations in progress. > > FYI, at least in your latest tree we only ever seem to set > xfs_inode_set_cowblocks_tag in xfs_swap_extents, so this effectively > isn't used during normal fs usage. The tag should be set at the end of __xfs_iomap_write_delay if we're creating a DA reservation in the CoW fork. > Also any reason we can't use the same infrastructure as our normal > speculative preallocation here? The two functions /could/ be merged but I'm hesitant to combine them because they run as different workqueue items. Setting speculative_cow_prealloc_lifetime to a (much) higher value than speculative_prealloc_lifetime has been useful for combatting CoW fragmentation on VM hosts where the VMs experience bursty write behaviors and we can keep the utilization ratios low enough that we don't start to run out of space. IOWs, it benefits us to keep the CoW fork reservations around for as long as we can unless we run out of blocks or hit inode reclaim. Regular speculative preallocations, otoh, can be removed quicker since file size changes don't happen much. --D _______________________________________________ xfs mailing list xfs@xxxxxxxxxxx http://oss.sgi.com/mailman/listinfo/xfs