[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4b7e4d48-f0f9-c0b0-e8e1-2678d0306252@redhat.com>
Date: Tue, 23 May 2023 16:00:39 +0200
From: David Hildenbrand <david@...hat.com>
To: xu xin <xu.xin.sc@...il.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.xin16@....com.cn,
yang.yang29@....com.cn
Subject: Re: [PATCH v8 1/6] ksm: support unsharing KSM-placed zero pages
On 23.05.23 15:57, xu xin wrote:
>>> ---
>>> include/linux/ksm.h | 6 ++++++
>>> mm/ksm.c | 5 +++--
>>> 2 files changed, 9 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/include/linux/ksm.h b/include/linux/ksm.h
>>> index 899a314bc487..7989200cdbb7 100644
>>> --- a/include/linux/ksm.h
>>> +++ b/include/linux/ksm.h
>>> @@ -26,6 +26,9 @@ int ksm_disable(struct mm_struct *mm);
>>>
>>> int __ksm_enter(struct mm_struct *mm);
>>> void __ksm_exit(struct mm_struct *mm);
>>> +/* use pte_mkdirty to track a KSM-placed zero page */
>>> +#define set_pte_ksm_zero(pte) pte_mkdirty(pte_mkspecial(pte))
>>
>> If there is only a single user (which I assume), please inline it instead.
>
> Excuse me, I'm wondering why using inline here instead of macro is better.
> Thanks! :)
Just to clarify: not an inline function but removing the macro
completely and just place that code directly into the single caller.
Single user, no need to put that into ksm.h -- and I'm not super happy
about the set_pte_ksm_zero() name ;) because we get the zero-pte already
passed in from the caller ...
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists