public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: xu <xu.xin.sc@gmail.com>
Cc: akpm@linux-foundation.org, imbrenda@linux.ibm.com,
	jiang.xuexin@zte.com.cn, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, ran.xiaokai@zte.com.cn,
	wang.yong12@zte.com.cn, xu.xin16@zte.com.cn,
	yang.yang29@zte.com.cn
Subject: Re: [PATCH] ksm: delay the check of splitting compound pages
Date: Wed, 15 Nov 2023 11:52:20 +0100	[thread overview]
Message-ID: <6bca32fa-6f9b-45ba-9bb2-59726f99a536@redhat.com> (raw)
In-Reply-To: <20231115031553.1970634-1-xu.xin16@zte.com.cn>

On 15.11.23 04:15, xu wrote:
>>> From: xu xin <xu.xin16@zte.com.cn>
>>>
>>> Background
>>> ==========
>>> When trying to merge two pages, it may fail because the two pages
>>> belongs to the same compound page and split_huge_page fails due to
>>> the incorrect reference to the page. To solve the problem, the commit
>>> 77da2ba0648a4 ("mm/ksm: fix interaction with THP") tries to split the
>>> compound page after try_to_merge_two_pages() fails and put_page in
>>> that case. However it is too early to calculate of the variable 'split' which
>>> indicates whether the two pages belongs to the same compound page.
>>>
>>> What to do
>>> ==========
>>> If try_to_merge_two_pages() succeeds, there is no need to check whether
>>> to splitting compound pages. So we delay the check of splitting compound
>>> pages until try_to_merge_two_pages() fails, which can improve the
>>> processing efficiency of cmp_and_merge_page() a little.
>>>
>>> Signed-off-by: xu xin <xu.xin16@zte.com.cn>
>>> Reviewed-by: Yang Yang <yang.yang29@zte.com.cn>
>>
>> Can we please add a unit test to ksm_functional_tests.c so we actually
>> get it right this time?
> 
> Sure. Maybe we can simply refer to the reproducing way Claudio proposes in
> 77da2ba0648a4 ("mm/ksm: fix interaction with THP").

So, was Claudio able to verify that his fix was correct, and how come we 
figure out 5 years later that that fix is insufficient?

Could it not have possibly worked, has something else changed in the 
meantime, or what's the deal here? Further elaborating on that in the 
patch description and adding a proper Fixes: tag will be appreciated ;)

-- 
Cheers,

David / dhildenb


  reply	other threads:[~2023-11-15 10:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 12:36 [PATCH] ksm: delay the check of splitting compound pages yang.yang29
2023-11-14 13:02 ` David Hildenbrand
2023-11-15  3:15   ` xu
2023-11-15 10:52     ` David Hildenbrand [this message]
2023-11-14 14:43 ` David Hildenbrand
2023-11-15  3:11   ` xu
2023-11-15 10:49     ` David Hildenbrand
2023-11-16 12:17       ` xu
2023-11-16 17:39         ` David Hildenbrand
2023-11-16 18:06           ` David Hildenbrand

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=6bca32fa-6f9b-45ba-9bb2-59726f99a536@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=imbrenda@linux.ibm.com \
    --cc=jiang.xuexin@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ran.xiaokai@zte.com.cn \
    --cc=wang.yong12@zte.com.cn \
    --cc=xu.xin.sc@gmail.com \
    --cc=xu.xin16@zte.com.cn \
    --cc=yang.yang29@zte.com.cn \
    /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