[Devel] [PATCH VZ9 0/4] ksm: port smart scanning and advisor to improve performance

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Wed Aug 21 09:45:40 MSK 2024


1) "Smart" scanning allows ksm to skip pages which didn't manage to be
deduplicated after several iterations, it skips those pages for maximum
8 iterations and then retries again. To enable:

echo 1 > /sys/kernel/mm/ksm/smart_scan

2) Ksm Advisor allows ksm to autoscale pages_to_scan based on previous
scans data to perform full memory scan in advisor_target_scan_time
(200s by default). It will increase scanning rate if new processes with
more pages to deduplicate start and will decrease performance impact
in more stable situations. To enable:

echo "scan-time" /sys/kernel/mm/ksm/advisor_mode

note: Don't forget to enable ksm, when using above, with:

echo 1 > /sys/kernel/mm/ksm/run

note: It shows greater performance on sysbench and webbench perf tests
in vconsolidate on csus > 40.

https://virtuozzo.atlassian.net/browse/PSBM-157809
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>


Stefan Roesch (4):
  mm/ksm: add "smart" page scanning mode
  mm/ksm: add pages_skipped metric
  mm/ksm: add ksm advisor
  mm/ksm: add sysfs knobs for advisor

 mm/ksm.c | 423 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 422 insertions(+), 1 deletion(-)

-- 
2.46.0



More information about the Devel mailing list