OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 0/2] ext4: replace the vz prefetch test_bit patch with the mainstream one
@ 2026-09-22 13:27 Konstantin Khorenko
  2026-09-22 13:27 ` [Devel] [PATCH hci-8.1 1/2] Revert "fs/ext4: do not run test_and_set_bit on every prefetch scan" Konstantin Khorenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Konstantin Khorenko @ 2026-09-22 13:27 UTC (permalink / raw)
  To: Alexey Kuznetsov, devel, Konstantin Khorenko

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@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@virtuozzo.com>

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-22 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 13:27 [Devel] [PATCH hci-8.1 0/2] ext4: replace the vz prefetch test_bit patch with the mainstream one Konstantin Khorenko
2026-09-22 13:27 ` [Devel] [PATCH hci-8.1 1/2] Revert "fs/ext4: do not run test_and_set_bit on every prefetch scan" Konstantin Khorenko
2026-09-22 13:27 ` [Devel] [PATCH hci-8.1 2/2] ext4: avoid RWM atomic in EXT4_MB_GRP_TEST_AND_SET_READ Konstantin Khorenko
2026-09-22 13:31 ` [Devel] [PATCH hci-8.1 0/2] ext4: replace the vz prefetch test_bit patch with the mainstream one Konstantin Khorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox