Linux EXT4 FS development
 help / color / mirror / Atom feed
* [PATCH v3 0/2] ext4: fix shrinker scan budget accounting, plus a related cleanup
@ 2026-09-30  7:11 Qiliang Yuan
  2026-09-30  7:11 ` [PATCH v3 1/2] ext4: fix shrinker scan budget accounting in ext4_es_scan() Qiliang Yuan
  2026-09-30  7:11 ` [PATCH v3 2/2] ext4: remove unused locked_ei parameter from __es_shrink() Qiliang Yuan
  0 siblings, 2 replies; 7+ messages in thread
From: Qiliang Yuan @ 2026-09-30  7:11 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, Baokun Li, Jan Kara,
	Ojaswin Mujoo, Ritesh Harjani (IBM), Zhang Yi
  Cc: linux-ext4, linux-kernel, Qiliang Yuan, stable

This revises the ext4_es_scan() shrinker scan-budget fix per review,
and adds a small follow-up cleanup noticed during that review.

Patch 1 simplifies the fix to just returning SHRINK_STOP when
__es_shrink() frees nothing, dropping the sc->nr_scanned computation
entirely (Zhang Yi and Sashiko AI both pointed out it added risk
without a corresponding benefit: do_shrink_slab() discards
sc->nr_scanned on SHRINK_STOP anyway, and computing an accurate but
small nonzero value could reduce the SHRINK_STOP hit rate under light
background load).

Patch 2 removes __es_shrink()'s locked_ei parameter, which Zhang Yi
noted is dead: its sole caller always passes NULL.

Signed-off-by: Qiliang Yuan <odys.yuan@gmail.com>
---
V2 -> V3:
- Drop the sc->nr_scanned computation entirely; just return
  SHRINK_STOP when __es_shrink() frees nothing (Zhang Yi, Sashiko AI
  review).
- Add patch 2/2: remove the now-dead locked_ei parameter (Zhang Yi).
- Add a Fixes: tag for the commit that split count_objects()/
  scan_objects() apart, and Cc: stable, matching the equivalent jbd2
  fix.
- Re-measure test data against the simplified fix (429 -> 238 calls).

V1 -> V2:
- Correct the comment and commit message: nr_scanned == 0 is not
  only reachable when sbi->s_es_list is genuinely empty, also when
  every inode walked was skipped or had nothing currently
  shrinkable. No code or test data changes.

v2: https://lore.kernel.org/r/20260929-fix-ext4-es-scan-nr-scanned-v2-1-f4e8f6f6b8b1@gmail.com
v1: https://lore.kernel.org/r/20260928-fix-ext4-es-scan-nr-scanned-v1-1-91d88228b0c8@gmail.com

---
Qiliang Yuan (2):
      ext4: fix shrinker scan budget accounting in ext4_es_scan()
      ext4: remove unused locked_ei parameter from __es_shrink()

 fs/ext4/extents_status.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)
---
base-commit: 502d801f0ab03e4f32f9a33d203154ce84887921
change-id: 20260928-fix-ext4-es-scan-nr-scanned-5af70744f6cd

Best regards,
-- 
Qiliang Yuan <odys.yuan@gmail.com>


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

end of thread, other threads:[~2026-09-30 17:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-30  7:11 [PATCH v3 0/2] ext4: fix shrinker scan budget accounting, plus a related cleanup Qiliang Yuan
2026-09-30  7:11 ` [PATCH v3 1/2] ext4: fix shrinker scan budget accounting in ext4_es_scan() Qiliang Yuan
2026-09-30  7:21   ` sashiko-bot
2026-09-30 17:42   ` Jan Kara
2026-09-30  7:11 ` [PATCH v3 2/2] ext4: remove unused locked_ei parameter from __es_shrink() Qiliang Yuan
2026-09-30  7:17   ` sashiko-bot
2026-09-30 17:34   ` Jan Kara

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