linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Chengming Zhou <chengming.zhou@linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>,
	aarcange@redhat.com, hughd@google.com, shr@devkernel.io
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	zhouchengming@bytedance.com
Subject: Re: [PATCH 1/4] mm/ksm: refactor out try_to_merge_with_zero_page()
Date: Mon, 27 May 2024 09:18:13 +0200	[thread overview]
Message-ID: <18ad1a9f-8f00-41c1-9c77-ac3252061852@redhat.com> (raw)
In-Reply-To: <36d4f3a6-c426-4455-b5be-2ab503d380ad@linux.dev>

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@linux.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.

-- 
Thanks,

David / dhildenb



  reply	other threads:[~2024-05-27  7:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-24  8:56 [PATCH 0/4] mm/ksm: cmp_and_merge_page() optimizations and cleanup Chengming Zhou
2024-05-24  8:56 ` [PATCH 1/4] mm/ksm: refactor out try_to_merge_with_zero_page() Chengming Zhou
2024-05-24 15:12   ` David Hildenbrand
2024-05-27  4:36     ` Chengming Zhou
2024-05-27  7:18       ` David Hildenbrand [this message]
2024-05-27  7:41         ` Chengming Zhou
2024-05-24  8:56 ` [PATCH 2/4] mm/ksm: don't waste time searching stable tree for fast changing page Chengming Zhou
2024-05-24  8:56 ` [PATCH 3/4] mm/ksm: optimize the chain()/chain_prune() interfaces Chengming Zhou
2024-05-24  8:56 ` [PATCH 4/4] mm/ksm: use ksm page itself if no another ksm page is found on stable tree Chengming Zhou

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=18ad1a9f-8f00-41c1-9c77-ac3252061852@redhat.com \
    --to=david@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=chengming.zhou@linux.dev \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shr@devkernel.io \
    --cc=zhouchengming@bytedance.com \
    /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