linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: <yang.yang29@zte.com.cn>
To: <david@redhat.com>
Cc: <akpm@linux-foundation.org>, <imbrenda@linux.ibm.com>,
	<jiang.xuexin@zte.com.cn>, <linux-kernel@vger.kernel.org>,
	<linux-mm@kvack.org>, <ran.xiaokai@zte.com.cn>,
	<xu.xin.sc@gmail.com>, <xu.xin16@zte.com.cn>
Subject: Re: [PATCH v5 2/6] ksm: support unsharing zero pages placed by KSM
Date: Sat, 4 Feb 2023 14:18:35 +0800 (CST)	[thread overview]
Message-ID: <202302041418359766772@zte.com.cn> (raw)
In-Reply-To: <60125c55-9ab7-7531-e124-cb676943fea6@redhat.com>

> Why use flags if they both conditions are mutually exclusive?

Just to make the return value of break_ksm_pmd_entry() more expressive and
understandable. because break_ksm_pmd_entry have three types of returned
values (0, 1, 2).

> MADV_UNMERGEABLE -> unmerge_ksm_pages() will never unshare the shared 
> zeropage? I thought the patch description mentions that that is one of 
> the goals?

No, MADV_UNMERGEABLE will trigger KSM to unshare the shared zeropages in the
context of "get_next_rmap_item() -> unshare_zero_pages(), but not directly in the
context of " madvise()-> unmerge_ksm_pages() ". The reason for this is to avoid
increasing long delays of madvise() calling on unsharing zero pages.


  reply	other threads:[~2023-02-04  6:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-30  1:13 yang.yang29
2023-01-18 14:10 ` David Hildenbrand
2023-02-04  6:18   ` yang.yang29 [this message]
2023-02-13 12:44     ` David Hildenbrand
2023-03-11  5:37 xu xin
2023-03-13 12:14 ` David Hildenbrand

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=202302041418359766772@zte.com.cn \
    --to=yang.yang29@zte.com.cn \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=imbrenda@linux.ibm.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 \
    /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