Commit 34eefc06 authored by Dave Chinner's avatar Dave Chinner Committed by Ben Myers

xfs: plug directory buffer readahead

Similar to bulkstat inode chunk readahead, we need to plug directory
data buffer readahead during getdents to ensure that we can merge
adjacent readahead requests and sort out of order requests optimally
before they are dispatched. This improves the readahead efficiency
and reduces the IO load it generates as the IO patterns are
significantly better for both contiguous and fragmented directories.
Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
Signed-off-by: default avatarBen Myers <bpm@sgi.com>
parent cbb2864a
...@@ -1108,6 +1108,7 @@ xfs_dir2_leaf_readbuf( ...@@ -1108,6 +1108,7 @@ xfs_dir2_leaf_readbuf(
struct xfs_mount *mp = dp->i_mount; struct xfs_mount *mp = dp->i_mount;
struct xfs_buf *bp = *bpp; struct xfs_buf *bp = *bpp;
struct xfs_bmbt_irec *map = mip->map; struct xfs_bmbt_irec *map = mip->map;
struct blk_plug plug;
int error = 0; int error = 0;
int length; int length;
int i; int i;
...@@ -1236,6 +1237,7 @@ xfs_dir2_leaf_readbuf( ...@@ -1236,6 +1237,7 @@ xfs_dir2_leaf_readbuf(
/* /*
* Do we need more readahead? * Do we need more readahead?
*/ */
blk_start_plug(&plug);
for (mip->ra_index = mip->ra_offset = i = 0; for (mip->ra_index = mip->ra_offset = i = 0;
mip->ra_want > mip->ra_current && i < mip->map_blocks; mip->ra_want > mip->ra_current && i < mip->map_blocks;
i += mp->m_dirblkfsbs) { i += mp->m_dirblkfsbs) {
...@@ -1287,6 +1289,7 @@ xfs_dir2_leaf_readbuf( ...@@ -1287,6 +1289,7 @@ xfs_dir2_leaf_readbuf(
} }
} }
} }
blk_finish_plug(&plug);
out: out:
*bpp = bp; *bpp = bp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment