]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ksm: count zero pages for each process
authorxu xin <xu.xin16@zte.com.cn>
Fri, 30 Dec 2022 01:16:29 +0000 (09:16 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 10 Feb 2023 23:36:02 +0000 (15:36 -0800)
commitd98e86df83259863ec297a44266ed8e3d8f5283f
tree205152c094561c9ec3c53fa286d836c2b6e27eb1
parent1b9a09a288d59a77d94f833641181c90f60f7319
ksm: count zero pages for each process

As the number of ksm zero pages is not included in ksm_merging_pages per
process when enabling use_zero_pages, it's unclear of how many actual
pages are merged by KSM.  To let users accurately estimate their memory
demands when unsharing KSM zero-pages, it's necessary to show KSM zero-
pages per process.

Since unsharing zero pages placed by KSM accurately is achieved, then
tracking empty pages merging and unmerging is not a difficult thing any
longer.

Since we already have /proc/<pid>/ksm_stat, just add the information of
zero_pages_sharing in it.

Link: https://lkml.kernel.org/r/202212300916292181912@zte.com.cn
Signed-off-by: xu xin <xu.xin16@zte.com.cn>
Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Xuexin Jiang <jiang.xuexin@zte.com.cn>
Cc: Xiaokai Ran <ran.xiaokai@zte.com.cn>
Cc: Yang Yang <yang.yang29@zte.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/base.c
include/linux/mm_types.h
mm/ksm.c