OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Alexey Kuznetsov <kuznet@virtuozzo.com>,
	devel@openvz.org, Konstantin Khorenko <khorenko@virtuozzo.com>
Subject: [Devel] [PATCH hci-8.1 0/2] ext4: replace the vz prefetch test_bit patch with the mainstream one
Date: Tue, 22 Sep 2026 15:27:46 +0200	[thread overview]
Message-ID: <20260922-pr-khorenko-vstor-145663-ext4-ms-v1-0-4dd83d495810@virtuozzo.com> (raw)

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

             reply	other threads:[~2026-09-22 13:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 13:27 Konstantin Khorenko [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260922-pr-khorenko-vstor-145663-ext4-ms-v1-0-4dd83d495810@virtuozzo.com \
    --to=khorenko@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=kuznet@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox