Skip to content

Commit cd22a51

Browse files
josefbacikkdave
authored andcommitted
btrfs: do not use readahead for running delayed refs
Readahead will generate a lot of extra reads for adjacent nodes, but when running delayed refs we have no idea if the next ref is going to be adjacent or not, so this potentially just generates a lot of extra IO. To make matters worse each ref is truly just looking for one item, it doesn't generally search forward, so we simply don't need it here. Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 9babda9 commit cd22a51

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

fs/btrfs/extent-tree.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,6 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
14471447
if (!path)
14481448
return -ENOMEM;
14491449

1450-
path->reada = READA_FORWARD;
14511450
path->leave_spinning = 1;
14521451
/* this will setup the path even if it fails to insert the back ref */
14531452
ret = insert_inline_extent_backref(trans, path, bytenr, num_bytes,
@@ -1472,7 +1471,6 @@ static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
14721471
btrfs_mark_buffer_dirty(leaf);
14731472
btrfs_release_path(path);
14741473

1475-
path->reada = READA_FORWARD;
14761474
path->leave_spinning = 1;
14771475
/* now insert the actual backref */
14781476
if (owner < BTRFS_FIRST_FREE_OBJECTID) {
@@ -1589,7 +1587,6 @@ static int run_delayed_extent_op(struct btrfs_trans_handle *trans,
15891587
}
15901588

15911589
again:
1592-
path->reada = READA_FORWARD;
15931590
path->leave_spinning = 1;
15941591
ret = btrfs_search_slot(trans, fs_info->extent_root, &key, path, 0, 1);
15951592
if (ret < 0) {
@@ -2978,7 +2975,6 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
29782975
if (!path)
29792976
return -ENOMEM;
29802977

2981-
path->reada = READA_FORWARD;
29822978
path->leave_spinning = 1;
29832979

29842980
is_data = owner_objectid >= BTRFS_FIRST_FREE_OBJECTID;

0 commit comments

Comments
 (0)