Skip to content

RFC btrfs: remove the metadata readahead mechanism

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: remove the unnecessary path parameter for scrub_raid56_parity()fs/btrfs/scrub.c+14 -140 replies
2/2btrfs: remove reada mechanismfs/btrfs/Makefile fs/btrfs/ctree.h fs/btrfs/dev-replace.c +7 more+3 -11890 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RFC 0/2] btrfs: remove the metadata readahead mechanism

This is originally just my preparation for scrub refactors, but when the readahead is involved, it won't just be a small cleanup.

The metadata readahead code is introduced in 2011 (surprisingly, the commit message even contains changelog), but now only one user for it, and even for the only one user, the readahead mechanism can't provide much help in fact.

Scrub needs readahead for commit root, but the existing one can only do current root readahead.

And the code is at a very bad layer inside btrfs, all metadata are at btrfs logical address space, but the readahead is kinda working at device layer (to manage the in-flight readahead).

Personally speaking, I don't think such "optimization" is really even needed, since we have better way like setting IO priority.

I really prefer to let the professional block layer guys do whatever they are good at (and in fact, those block layer guys rock!). Immature optimization is the cause of bugs, and it has already caused several bugs recently.

Nowadays we have btrfs_path::reada to do the readahead, I doubt if we really need such facility.

So here I purpose to completely remove the old and under utilized metadata readahead system.

Qu Wenruo (2):
btrfs: remove the unnecessary path parameter for scrub_raid56_parity()
btrfs: remove reada mechanism

 fs/btrfs/Makefile      |    2 +-
 fs/btrfs/ctree.h       |   25 -
 fs/btrfs/dev-replace.c |    5 -
 fs/btrfs/disk-io.c     |   20 +-
 fs/btrfs/extent_io.c   |    3 -
 fs/btrfs/reada.c       | 1086 ----------------------------------------
 fs/btrfs/scrub.c       |   64 +--
 fs/btrfs/super.c       |    1 -
 fs/btrfs/volumes.c     |    7 -
 fs/btrfs/volumes.h     |    7 -
 10 files changed, 17 insertions(+), 1203 deletions(-)
 delete mode 100644 fs/btrfs/reada.c
Signature · 1 line
2.34.1