Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] mm: zsmalloc: make shrinker compaction budget-aware
@ 2026-08-06  8:27 xueyuan.chen
  2026-08-06  8:27 ` [RFC PATCH 1/2] mm: zsmalloc: add a page limit to pool compaction xueyuan.chen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: xueyuan.chen @ 2026-08-06  8:27 UTC (permalink / raw)
  To: Minchan Kim, Sergey Senozhatsky, Andrew Morton
  Cc: linux-mm, linux-kernel, xueyuan.chen21

From: Xueyuan Chen <xueyuan.chen@vivo.com>

zs_shrinker_scan() currently calls zs_compact(), which compacts the whole
pool regardless of sc->nr_to_scan. A single shrinker callback can therefore
reclaim much more than requested and spend a long time in compaction.

On an Android device with 12 GB of RAM, observed zsmalloc compaction
durations had a p95 of 38.86 ms and a maximum of 269.68 ms, motivating a
per-scan reclaim goal.

This series uses sc->nr_to_scan as a reclaimed-page goal and keeps a
per-pool size-class cursor so later scans resume where the previous scan
stopped. The existing full-pool behavior of zs_compact() is unchanged.

Xueyuan Chen (2):
  mm: zsmalloc: add a page limit to pool compaction
  mm: zsmalloc: use the shrinker reclaim budget

 mm/zsmalloc.c | 46 +++++++++++++++++++++++++++++++---------------
 1 file changed, 31 insertions(+), 15 deletions(-)

--
2.47.3




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

end of thread, other threads:[~2026-08-07  3:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06  8:27 [RFC PATCH 0/2] mm: zsmalloc: make shrinker compaction budget-aware xueyuan.chen
2026-08-06  8:27 ` [RFC PATCH 1/2] mm: zsmalloc: add a page limit to pool compaction xueyuan.chen
2026-08-06  8:27 ` [RFC PATCH 2/2] mm: zsmalloc: use the shrinker reclaim budget xueyuan.chen
2026-08-07  3:56 ` [RFC PATCH 0/2] mm: zsmalloc: make shrinker compaction budget-aware Sergey Senozhatsky

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