linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] ksm: support tracking KSM-placed zero-pages
@ 2022-10-08  7:01 xu.xin.sc
  2022-10-08  7:05 ` [PATCH 2/5] ksm: support unsharing zero pages placed by KSM xu.xin.sc
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: xu.xin.sc @ 2022-10-08  7:01 UTC (permalink / raw)
  To: akpm
  Cc: ran.xiaokai, yang.yang29, jiang.xuexin, imbrenda, david,
	linux-mm, linux-kernel, xu xin

From: xu xin <xu.xin16@zte.com.cn>

Before enabling use_zero_pages by setting /sys/kernel/mm/ksm/
use_zero_pages to 1, pages_sharing of KSM is basically accurate. But
when enabling use_zero_pages, all empty pages that are merged with
kernel zero page are not counted in pages_sharing or pages_shared.
That is because these empty pages are merged with zero-pages then no
longer managed by KSM, which leads to two issues at least:

1) MADV_UNMERGEABLE and other ways to trigger unsharing will *not*
   unshare the shared zeropage as placed by KSM (which is against the 
   MADV_UNMERGEABLE documentation at least); see the link:
   https://lore.kernel.org/lkml/4a3daba6-18f9-d252-697c-197f65578c44@redhat.com/

2) we cannot know how many pages are zero pages placed by KSM when
   enabling use_zero_pages, which leads to KSM not being transparent
   with all actual merged pages by KSM.

With the patch series, we can unshare zero-pages(KSM-placed) accurately
and count ksm zero pages.


*** BLURB HERE ***

xu xin (5):
  ksm: abstract the function try_to_get_old_rmap_item
  ksm: support unsharing zero pages placed by KSM
  ksm: count all zero pages placed by KSM
  ksm: count zero pages for each process
  ksm: add zero_pages_sharing documentation

 Documentation/admin-guide/mm/ksm.rst |  10 +-
 fs/proc/base.c                       |   1 +
 include/linux/mm_types.h             |   7 +-
 mm/ksm.c                             | 177 +++++++++++++++++++++------
 4 files changed, 157 insertions(+), 38 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-08 13:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-08  7:01 [PATCH 0/5] ksm: support tracking KSM-placed zero-pages xu.xin.sc
2022-10-08  7:05 ` [PATCH 2/5] ksm: support unsharing zero pages placed by KSM xu.xin.sc
2022-10-08  7:06 ` [PATCH 3/5] ksm: count all " xu.xin.sc
2022-10-08  7:06 ` [PATCH 4/5] ksm: count zero pages for each process xu.xin.sc
2022-10-08 13:55   ` kernel test robot
2022-10-08  7:07 ` [PATCH 5/5] ksm: add zero_pages_sharing documentation xu.xin.sc
2022-10-08  7:08 ` [PATCH 1/5] ksm: abstract the function try_to_get_old_rmap_item xu.xin.sc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).