Linux EXT4 FS development
 help / color / mirror / Atom feed
* [PATCH 0/2] ext4: fix goal trimming in CR_BEST_AVAIL_LEN
@ 2026-11-22 18:56 Muhammad Umer
  2026-11-22 18:56 ` [PATCH 1/2] ext4: scan all groups before trimming the goal " Muhammad Umer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Muhammad Umer @ 2026-11-22 18:56 UTC (permalink / raw)
  To: linux-ext4
  Cc: tytso, adilger.kernel, libaokun, jack, ojaswin, ritesh.list,
	yi.zhang, Muhammad Umer

Two issues in ext4_mb_scan_groups_best_avail() that make mballoc trim
allocations more than needed or skip CR_BEST_AVAIL_LEN entirely.

1/2: groups below the scan start are only searched after the goal has
     been trimmed to min_order. Regression from a3ce570a5d6a (v6.17).
2/2: min_order is one order too high for power-of-two requests, so they
     fall through to CR_GOAL_LEN_SLOW. Present since 7e170922f06b.

Both reproduce on 6.18.44, 7.1.5 and 7.2.15. The two fixes were tested
together on 7.2.15. Reproducers (loop device, run as root, read the
ext4_mballoc_alloc tracepoint):

  https://github.com/mumer2834/ext4-best-avail-repro

Patch 1 only changes the order in which CR_BEST_AVAIL_LEN visits groups;
CR_POWER2_ALIGNED and CR_GOAL_LEN_FAST keep the linear-like traversal
from a3ce570a5d6a. I have not measured multi-writer contention with this
change.



Muhammad Umer (2):
  ext4: scan all groups before trimming the goal in CR_BEST_AVAIL_LEN
  ext4: fix off-by-one in CR_BEST_AVAIL_LEN min_order

 fs/ext4/mballoc.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)


base-commit: 4843f6873f7c4835e62f2c73ba0fd538e57a2f22
-- 
2.53.0


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

end of thread, other threads:[~2026-11-22 19:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 18:56 [PATCH 0/2] ext4: fix goal trimming in CR_BEST_AVAIL_LEN Muhammad Umer
2026-11-22 18:56 ` [PATCH 1/2] ext4: scan all groups before trimming the goal " Muhammad Umer
2026-11-22 18:56 ` [PATCH 2/2] ext4: fix off-by-one in CR_BEST_AVAIL_LEN min_order Muhammad Umer
2026-11-22 19:01 ` [PATCH 0/2] ext4: fix goal trimming in CR_BEST_AVAIL_LEN sashiko-bot

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