[Devel] [PATCH hci-8.1 0/2] ext4: replace the vz prefetch test_bit patch with the mainstream one
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Sep 22 16:27:46 MSK 2026
The vz patch 3fff8724d1f89 ("fs/ext4: do not run test_and_set_bit on
every prefetch scan") went in for VSTOR-137147 to stop
ext4_mb_prefetch() from doing a locked test_and_set_bit on bb_state of
every group it walks. The bit is set-only, yet the atomic RMW took the
ext4_group_info cache line exclusive on every pass and bounced it
between allocating threads.
Mainstream fixed the same thing before us: v7.3-rc1 carries
0e364a030229b ("ext4: avoid RWM atomic in EXT4_MB_GRP_TEST_AND_SET_READ")
by Bohdan Trach. The logic is identical, test_bit first and the atomic
only while the bit is still clear. The only difference is where the
check lives: the vz patch adds a second macro and tests it at the call
site, the mainstream one folds the test into
EXT4_MB_GRP_TEST_AND_SET_READ() itself. ext4_mb_prefetch() is the only
user of the macro, so the resulting code is the same either way.
Revert the vz patch and cherry-pick the mainstream commit, so that the
tree matches what the rebase to 7.3 brings anyway and this spot does
not turn into a conflict there.
https://virtuozzo.atlassian.net/browse/VSTOR-137147
https://virtuozzo.atlassian.net/browse/VSTOR-145663
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
Bohdan Trach (1):
ext4: avoid RWM atomic in EXT4_MB_GRP_TEST_AND_SET_READ
Konstantin Khorenko (1):
Revert "fs/ext4: do not run test_and_set_bit on every prefetch scan"
fs/ext4/ext4.h | 10 +++++++---
fs/ext4/mballoc.c | 4 +---
2 files changed, 8 insertions(+), 6 deletions(-)
---
base-commit: 60a71f6c543ed4d4815774d57241370aa6475041
change-id: 20260922-pr-khorenko-vstor-145663-ext4-ms-2c3cdcb3a7fb
Best regards,
--
Konstantin Khorenko <khorenko at virtuozzo.com>
More information about the Devel
mailing list