[RFC PATCH 0/2] SKSM: Synchronous Kernel Samepage Merging

From: Mathieu Desnoyers
Date: Thu Feb 27 2025 - 21:31:16 EST


This series introduces SKSM, a new page deduplication ABI,
aiming to fix the limitations inherent to the KSM ABI.

The implementation is simple enough: SKSM is implemented in about 100
LOC compared to 2.5k LOC for KSM (on top of the common KSM helpers).

This is sent as a proof of concept. It applies on top of v6.13.

Feedback is welcome!

Mathieu

Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
Cc: Olivier Dion <odion@xxxxxxxxxxxx>
Cc: linux-mm@xxxxxxxxx

Mathieu Desnoyers (2):
mm: Introduce SKSM: Synchronous Kernel Samepage Merging
selftests/kskm: Introduce SKSM basic test

include/linux/ksm.h | 4 +
include/linux/mm_types.h | 7 +
include/linux/page-flags.h | 42 ++++
include/linux/sksm.h | 27 +++
include/uapi/asm-generic/mman-common.h | 2 +
mm/Kconfig | 5 +
mm/Makefile | 1 +
mm/ksm-common.h | 228 ++++++++++++++++++++++
mm/ksm.c | 219 +--------------------
mm/madvise.c | 6 +
mm/memory.c | 2 +
mm/page_alloc.c | 3 +
mm/sksm.c | 190 ++++++++++++++++++
tools/testing/selftests/sksm/.gitignore | 2 +
tools/testing/selftests/sksm/Makefile | 14 ++
tools/testing/selftests/sksm/basic_test.c | 217 ++++++++++++++++++++
16 files changed, 751 insertions(+), 218 deletions(-)
create mode 100644 include/linux/sksm.h
create mode 100644 mm/ksm-common.h
create mode 100644 mm/sksm.c
create mode 100644 tools/testing/selftests/sksm/.gitignore
create mode 100644 tools/testing/selftests/sksm/Makefile
create mode 100644 tools/testing/selftests/sksm/basic_test.c

--
2.39.5