[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230524075539.20844-1-xu.xin16@zte.com.cn>
Date:   Wed, 24 May 2023 15:55:39 +0800
From:   xu xin <xu.xin.sc@...il.com>
To:     david@...hat.com
Cc:     akpm@...ux-foundation.org, imbrenda@...ux.ibm.com,
        jiang.xuexin@....com.cn, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, ran.xiaokai@....com.cn, xu.xin.sc@...il.com,
        xu.xin16@....com.cn, yang.yang29@....com.cn
Subject: Re: [PATCH v9 2/5] ksm: count all zero pages placed by KSM
>> +extern unsigned long ksm_zero_pages;
>> +
>> +static inline void ksm_notify_unmap_zero_page(pte_t pte)
>> +{
>> +	if (is_ksm_zero_pte(pte))
>> +		ksm_zero_pages--;
>> +}
>> +
>>   static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm)
>>   {
>>   	int ret;
>> @@ -103,6 +111,10 @@ static inline void ksm_exit(struct mm_struct *mm)
>>   
>>   #define is_ksm_zero_pte(pte)	0
>>   
>> +static inline void ksm_notify_unmap_zero_page(pte_t pte)
>> +{
>> +}
>> +
>
>Having proposed that name ... I realize that we call this function 
>whenever there might be a zeropage mapped (when we have !page after 
>vm_normal_page()) -- but it could also not be the zeropage.
>
>Not really able to come up with a better name :)
>
>ksm_notify_maybe_unmap_zero_page ?
>
>ksm_maybe_unmap_zero_page ?
>
Analogous to the existing name of ksm_might_need_to_copy, so maybe we can use
'ksm_might_unmap_zero_page', 
>
>Maybe someone else reading along has a better idea. In any case, the 
>logic itself LGTM
Powered by blists - more mailing lists