linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: yang.yang29@zte.com.cn
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 3/6] ksm: count all zero pages placed by KSM
Date: Mon, 13 Feb 2023 13:55:22 +0100	[thread overview]
Message-ID: <2b62898c-2f39-bc0d-e801-20b5efe90dfd@redhat.com> (raw)
In-Reply-To: <202302092001576896055@zte.com.cn>

On 09.02.23 13:01, yang.yang29@zte.com.cn wrote:
>>> diff --git a/mm/ksm.c b/mm/ksm.c
>>> index 652c088f9786..72c0722be280 100644
>>> --- a/mm/ksm.c
>>> +++ b/mm/ksm.c
>>> @@ -276,6 +276,9 @@ static unsigned int zero_checksum __read_mostly;
>>>    /* Whether to merge empty (zeroed) pages with actual zero pages */
>>>    static bool ksm_use_zero_pages __read_mostly;
>>>
>>> +/* The number of zero pages placed by KSM use_zero_pages */
>>> +static unsigned long ksm_zero_pages_sharing;
>>
>> Does this count how many zero pages are currently placed or how many
>> rmap items with ZERO_PAGE_FLAG are in the system?
> 
> Yes, it counts how many ksm zero pages are currently placed. and we use
> rmap items with ZERO_PAGE_FLAG to record these zero page, similar to
> ksm_pages_sharing and ksm_pages_shared which are recorded by the rmap_items
> with STABLE_FLAG.
> 
>>
>> IOW, if someone triggers MADV_DONTNEED on such a zeropage, the counter
>> will not get updated, correct?
> 
> Well, the counter can get updated as someone triggers MADV_DONTNEED on such
> a zeropage. You might write a simple code to test it.

Interesting, I'll have a look how that will be triggered.

-- 
Thanks,

David / dhildenb



      reply	other threads:[~2023-02-13 12:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-30  1:15 yang.yang29
2023-01-18 14:30 ` David Hildenbrand
2023-02-09 12:01   ` yang.yang29
2023-02-13 12:55     ` David Hildenbrand [this message]

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=2b62898c-2f39-bc0d-e801-20b5efe90dfd@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --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 \
    --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