From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: xu.xin.sc@gmail.com
Cc: akpm@linux-foundation.org, ran.xiaokai@zte.com.cn,
yang.yang29@zte.com.cn, jiang.xuexin@zte.com.cn,
david@redhat.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, xu xin <xu.xin16@zte.com.cn>
Subject: Re: [PATCH v2 0/5] ksm: support tracking KSM-placed zero-pages
Date: Mon, 10 Oct 2022 11:24:13 +0200 [thread overview]
Message-ID: <20221010112413.219dc989@p-imbrenda> (raw)
In-Reply-To: <20221009021816.315205-1-xu.xin16@zte.com.cn>
On Sun, 9 Oct 2022 02:18:16 +0000
xu.xin.sc@gmail.com wrote:
> 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.
why are you trying so hard to fix something that is not broken?
can't you just avoid using use_zero_pages?
why is it so important to know how many zero pages have been merged?
and why do you want to unmerge them?
the important thing is that the sysadmin knows how much memory would be
needed to do the unmerge, and that information is already there.
>
> ---
> v1->v2:
>
> [patch 4/5] fix build warning, mm/ksm.c:550, misleading indentation; statement
> 'rmap_item->mm->ksm_zero_pages_sharing--;' is not part of the previous 'if'.
>
>
>
> *** 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(-)
>
next prev parent reply other threads:[~2022-10-10 9:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-09 2:18 xu.xin.sc
2022-10-09 2:19 ` [PATCH v2 1/5] ksm: abstract the function try_to_get_old_rmap_item xu.xin.sc
2022-10-09 2:23 ` [PATCH v2 2/5] ksm: support unsharing zero pages placed by KSM xu.xin.sc
2022-10-09 2:23 ` [PATCH v2 3/5] ksm: count all " xu.xin.sc
2022-10-09 2:23 ` [PATCH v2 4/5] ksm: count zero pages for each process xu.xin.sc
2022-10-09 2:23 ` [PATCH v2 5/5] ksm: add zero_pages_sharing documentation xu.xin.sc
2022-10-10 9:24 ` Claudio Imbrenda [this message]
2022-10-10 12:08 ` [PATCH v2 0/5] ksm: support tracking KSM-placed zero-pages xu xin
2022-10-10 13:42 ` Claudio Imbrenda
2022-10-11 2:31 ` xu xin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221010112413.219dc989@p-imbrenda \
--to=imbrenda@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=jiang.xuexin@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ran.xiaokai@zte.com.cn \
--cc=xu.xin.sc@gmail.com \
--cc=xu.xin16@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox