• Brian Foster's avatar
    xfs: skip online discard during eofblocks trims · 13b86fc3
    Brian Foster authored
    We've had reports of online discard operations being sent from XFS
    on write-only workloads. These discards occur as a result of
    eofblocks trims that can occur after a large file copy completes.
    
    These discards are slightly confusing for users who might be paying
    close attention to online discards (i.e., vdo) due to performance
    sensitivity. They also happen to be spurious because freed post-eof
    blocks by definition have not been written to during the current
    allocation cycle.
    
    Update xfs_free_eofblocks() to skip discards that are purely
    attributed to eofblocks trims. This cuts down the number of spurious
    discards that may occur on write-only workloads due to normal
    preallocation activity.
    
    Note that discards of post-eof extents can still occur from other
    codepaths that do not isolate handling of post-eof blocks from those
    within eof. For example, file unlinks and truncates may still cause
    discards for any file blocks affected by the operation.
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    13b86fc3
xfs_inode.c 100 KB