Skip to content

Commit 5c82a47

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: move invalidate_kernel_vmap_range to xfs_buf_ioend
Invalidating cache lines can be fairly expensive, so don't do it in interrupt context. Note that in practice very few setup will actually do anything here as virtually indexed caches are rather uncommon, but we might as well move the call to the proper place while touching this area. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Acked-by: Dave Chinner <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent fac69ec commit 5c82a47

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/xfs/xfs_buf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,9 @@ xfs_buf_ioend(
13631363
trace_xfs_buf_iodone(bp, _RET_IP_);
13641364

13651365
if (bp->b_flags & XBF_READ) {
1366+
if (!bp->b_error && xfs_buf_is_vmapped(bp))
1367+
invalidate_kernel_vmap_range(bp->b_addr,
1368+
xfs_buf_vmap_len(bp));
13661369
if (!bp->b_error && bp->b_ops)
13671370
bp->b_ops->verify_read(bp);
13681371
if (!bp->b_error)
@@ -1492,9 +1495,6 @@ xfs_buf_bio_end_io(
14921495
XFS_TEST_ERROR(false, bp->b_mount, XFS_ERRTAG_BUF_IOERROR))
14931496
xfs_buf_ioerror(bp, -EIO);
14941497

1495-
if (!bp->b_error && xfs_buf_is_vmapped(bp) && (bp->b_flags & XBF_READ))
1496-
invalidate_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp));
1497-
14981498
xfs_buf_ioend_async(bp);
14991499
bio_put(bio);
15001500
}

0 commit comments

Comments
 (0)