summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/mm/vm_util.h
diff options
context:
space:
mode:
authorWei Yang <richard.weiyang@gmail.com>2025-08-19 08:00:46 +0000
committerAndrew Morton <akpm@linux-foundation.org>2025-09-13 16:55:13 -0700
commitb27f292de6b1a39e9fb0f83c79dfe902a9ea86c3 (patch)
tree43354213ec489c240b0f13b585509014aa82213c /tools/testing/selftests/mm/vm_util.h
parent63ec0c26b682ca235953490dfa82b8fa4d4ab4a0 (diff)
selftests/mm: put general ksm operation into vm_util
Patch series "test that rmap behaves as expected", v4. As David suggested, currently we don't have a high level test case to verify the behavior of rmap. This patch set introduce the verification on rmap by migration. Patch 1 is a preparation to move ksm related operations into vm_util. Patch 2 is the new test case for rmap. Currently it covers following four scenarios: * anonymous page * shmem page * pagecache page * ksm page This patch (of 2): There are some general ksm operations could be used by other related test cases. Put them into vm_util for common use. This is a preparation patch for later use. Link: https://lkml.kernel.org/r/20250819080047.10063-1-richard.weiyang@gmail.com Link: https://lkml.kernel.org/r/20250819080047.10063-2-richard.weiyang@gmail.com Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Suggested-by: David Hildenbrand <david@redhat.com> Cc: David Hildenbrand <david@redhat.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Rik van Riel <riel@surriel.com> Cc: Liam R. Howlett <Liam.Howlett@oracle.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Harry Yoo <harry.yoo@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/mm/vm_util.h')
-rw-r--r--tools/testing/selftests/mm/vm_util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h
index ab8722f482ae..07c4acfd84b6 100644
--- a/tools/testing/selftests/mm/vm_util.h
+++ b/tools/testing/selftests/mm/vm_util.h
@@ -139,6 +139,13 @@ static inline int sz2ord(size_t size, size_t pagesize)
void *sys_mremap(void *old_address, unsigned long old_size,
unsigned long new_size, int flags, void *new_address);
+long ksm_get_self_zero_pages(void);
+long ksm_get_self_merging_pages(void);
+long ksm_get_full_scans(void);
+int ksm_use_zero_pages(void);
+int ksm_start(void);
+int ksm_stop(void);
+
/*
* On ppc64 this will only work with radix 2M hugepage size
*/