lkml.org 
[lkml]   [2023]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v9 2/5] ksm: count all zero pages placed by KSM
From
On 24.05.23 09:55, xu xin wrote:
>>> +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',

Yes, that should work :)

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2023-05-24 10:30    [W:0.096 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site