Skip to content

RFC mm: zsmalloc: make shrinker compaction budget-aware

[email protected] linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 37 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mm: zsmalloc: add a page limit to pool compactionmm/zsmalloc.c+17 -40 replies
2/2mm: zsmalloc: use the shrinker reclaim budgetmm/zsmalloc.c+18 -150 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] mm: zsmalloc: make shrinker compaction budget-aware

From: Xueyuan Chen <[email protected]>

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