]> git.hungrycats.org Git - bees/commit
readahead: ignore large and unproductive readahead requests
authorZygo Blaxell <bees@furryterror.org>
Tue, 22 Jul 2025 01:01:00 +0000 (21:01 -0400)
committerZygo Blaxell <bees@furryterror.org>
Tue, 22 Jul 2025 01:21:54 +0000 (21:21 -0400)
commite87f6e9649e2bdf056ae41bdfd6408449da42339
tree77da02d3c210a6ee4782692e21cd2370b00c5193
parentfb63bd7e06f078740676d299f4d4d3584b39b107
readahead: ignore large and unproductive readahead requests

Sometimes there are absurdly large readahead requests (e.g. 32G),
which tie up a thread holding the readahead lock for a long time (not
to mention the IO the reading hammers the rest of the system with).

These are likely an artifact of the legacy ExtentWalker code interacting
with concurrent filesystem changes.

The maximum btrfs extent size is 128M, so cap the length of readahead
requests at that size.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
src/bees.cc