mm/ksm: add sysfs knobs for advisor
authorStefan Roesch <shr@devkernel.io>
Mon, 18 Dec 2023 23:10:52 +0000 (15:10 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 Dec 2023 19:58:27 +0000 (11:58 -0800)
commit66790e9a735b5c42349c48881e496b6946a55c05
tree1d2b5102c4d320a6418f00ed22e4653b110497ba
parent4e5fa4f5eff66ac654c5f3aa1b6f94d242ccae03
mm/ksm: add sysfs knobs for advisor

This adds four new knobs for the KSM advisor to influence its behaviour.

The knobs are:
- advisor_mode:
    none:      no advisor (default)
    scan-time: scan time advisor
- advisor_max_cpu: 70 (default, cpu usage percent)
- advisor_min_pages_to_scan: 500 (default)
- advisor_max_pages_to_scan: 30000 (default)
- advisor_target_scan_time: 200 (default in seconds)

The new values will take effect on the next scan round.

Link: https://lkml.kernel.org/r/20231218231054.1625219-3-shr@devkernel.io
Signed-off-by: Stefan Roesch <shr@devkernel.io>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Rik van Riel <riel@surriel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/ksm.c