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 1/2] Revert "fs/ext4: do not run test_and_set_bit on every prefetch scan"
Date: Tue, 22 Sep 2026 15:27:47 +0200 [thread overview]
Message-ID: <20260922-pr-khorenko-vstor-145663-ext4-ms-v1-1-4dd83d495810@virtuozzo.com> (raw)
In-Reply-To: <20260922-pr-khorenko-vstor-145663-ext4-ms-v1-0-4dd83d495810@virtuozzo.com>
This reverts commit 3fff8724d1f894459c1477990fe086c0c2573410.
Mainstream has already fixed this issue the same way, only with the
test_bit check folded into the macro instead of the call site, so drop
our patch and take the mainstream version:
0e364a030229b ("ext4: avoid RWM atomic in EXT4_MB_GRP_TEST_AND_SET_READ")
https://virtuozzo.atlassian.net/browse/VSTOR-137147
https://virtuozzo.atlassian.net/browse/VSTOR-145663
Feature: fix ms/ext4
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
fs/ext4/ext4.h | 2 --
fs/ext4/mballoc.c | 4 +---
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index ca6498609e2e1..bf7637785e073 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -3514,8 +3514,6 @@ struct ext4_group_info {
(clear_bit(EXT4_GROUP_INFO_WAS_TRIMMED_BIT, &((grp)->bb_state)))
#define EXT4_MB_GRP_TEST_AND_SET_READ(grp) \
(test_and_set_bit(EXT4_GROUP_INFO_BBITMAP_READ_BIT, &((grp)->bb_state)))
-#define EXT4_MB_GRP_TEST_READ(grp) \
- (test_bit(EXT4_GROUP_INFO_BBITMAP_READ_BIT, &((grp)->bb_state)))
#define EXT4_MAX_CONTENTION 8
#define EXT4_CONTENTION_THRESHOLD 2
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index b50aa34057967..aaf2c24c514c6 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2836,9 +2836,7 @@ ext4_group_t ext4_mb_prefetch(struct super_block *sb, ext4_group_t group,
* prefetch once, so we avoid getblk() call, which can
* be expensive.
*/
- if (gdp && grp &&
- !EXT4_MB_GRP_TEST_READ(grp) &&
- !EXT4_MB_GRP_TEST_AND_SET_READ(grp) &&
+ if (gdp && grp && !EXT4_MB_GRP_TEST_AND_SET_READ(grp) &&
EXT4_MB_GRP_NEED_INIT(grp) &&
ext4_free_group_clusters(sb, gdp) > 0 ) {
bh = ext4_read_block_bitmap_nowait(sb, group, true);
--
2.43.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent 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 [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 ` Konstantin Khorenko [this message]
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-1-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.