linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: David Hildenbrand <david@redhat.com>, <akpm@linux-foundation.org>
Cc: <mhocko@suse.com>, <vbabka@suse.cz>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] mm/page_isolation: fix potential missing call to unset_migratetype_isolate()
Date: Wed, 15 Sep 2021 14:26:15 +0800	[thread overview]
Message-ID: <660c452e-521b-a5de-1170-0327421e181e@huawei.com> (raw)
In-Reply-To: <454bd51f-d7ee-6304-af23-7c95874f8890@redhat.com>

On 2021/9/15 2:13, David Hildenbrand wrote:
> On 14.09.21 13:43, Miaohe Lin wrote:
>> In start_isolate_page_range() undo path, pfn_to_online_page() just checks
>> the first pfn in a pageblock while __first_valid_page() will traverse the
>> pageblock until the first online pfn is found. So we may miss the call to
>> unset_migratetype_isolate() in undo path and pages will remain isolated
>> unexpectedly. Fix this by calling undo_isolate_page_range() and this will
>> also help to simplify the code further. Note we shouldn't ever trigger it
>> because MAX_ORDER-1 aligned pfn ranges shouldn't contain memory holes now.
>>
>> Fixes: 2ce13640b3f4 ("mm: __first_valid_page skip over offline pages")
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> 
> I read Michals reply, however, I am quite conservative with Fixes: tags. If there is nothing to fix, there is no BUG and the patch consequently merely a cleanup.
> 
> I'd have gone with a patch description/subject as follows:
> 
> "
> mm/page_isolation: cleanup start_isolate_page_range()
> 
> We can heavily simplify the code by reusing undo_isolate_page_range().
> 
> Note that this also tackles a theoretical issue that would have been a real BUG before commit c5e79ef561b0 ("mm/memory_hotplug.c: don't allow to online/offline memory blocks with holes"). In start_isolate_page_range() undo path, pfn_to_online_page() just checks
> the first pfn in a pageblock while __first_valid_page() will traverse the pageblock until the first online pfn is found. So we may miss the call to unset_migratetype_isolate() in undo path and pages will remain isolated unexpectedly.
> 
> Nowadays, start_isolate_page_range() never gets called on ranges that might contain memory holes. Consequently, this patch is not a fix but a cleanup.
> "
> 
> Anyhow, whatever the other people prefer, no strong opinion.

I have no preference too. But if this is preferred, I will do it.

> 
> Reviewed-by: David Hildenbrand <david@redhat.com>

Many thanks! :)

> 



      reply	other threads:[~2021-09-15  6:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 11:43 Miaohe Lin
2021-09-14 18:13 ` David Hildenbrand
2021-09-15  6:26   ` Miaohe Lin [this message]

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=660c452e-521b-a5de-1170-0327421e181e@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=vbabka@suse.cz \
    /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