[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f839ae47-2776-4684-a331-564554426ae2@linux.dev>
Date: Mon, 27 May 2024 15:41:21 +0800
From: Chengming Zhou <chengming.zhou@...ux.dev>
To: David Hildenbrand <david@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>, aarcange@...hat.com,
hughd@...gle.com, shr@...kernel.io
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
zhouchengming@...edance.com
Subject: Re: [PATCH 1/4] mm/ksm: refactor out try_to_merge_with_zero_page()
On 2024/5/27 15:18, David Hildenbrand wrote:
> Am 27.05.24 um 06:36 schrieb Chengming Zhou:
>> On 2024/5/24 23:12, David Hildenbrand wrote:
>>> On 24.05.24 10:56, Chengming Zhou wrote:
>>>> In preparation for later changes, refactor out a new function called
>>>> try_to_merge_with_zero_page(), which tries to merge with zero page.
>>>>
>>>> Signed-off-by: Chengming Zhou <chengming.zhou@...ux.dev>
>>>> ---
>>>> mm/ksm.c | 67 +++++++++++++++++++++++++++++++++++-----------------------------
>>>> 1 file changed, 37 insertions(+), 30 deletions(-)
>>>>
>>>> diff --git a/mm/ksm.c b/mm/ksm.c
>>>> index 4dc707d175fa..cbd4ba7ea974 100644
>>>> --- a/mm/ksm.c
>>>> +++ b/mm/ksm.c
>>>> @@ -1531,6 +1531,41 @@ static int try_to_merge_one_page(struct vm_area_struct *vma,
>>>> return err;
>>>> }
>>>> +/* This function returns 0 if the pages were merged, -EFAULT otherwise. */
>>>
>>> No it doesn't. Check the "err = 0" case.
>>>
>>
>> Right, how about this: This function returns 0 if the page were merged or the vma
>> is out of date, which means we don't need to continue, -EFAULT otherwise.
>
> Maybe slightly adjusted:
>
> This function returns 0 if the pages were merged or if they are no longer merging candidates (e.g., VMA stale), -EFAULT otherwise.
>
Great, will change to this. Thanks!
Powered by blists - more mailing lists