linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Michal Hocko <mhocko@suse.com>
Cc: akpm@linux-foundation.org, mgorman@techsingularity.net,
	vbabka@suse.cz, david@redhat.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/page_alloc: consider pfn holes after pfn_valid() in __pageblock_pfn_to_page()
Date: Wed, 12 Apr 2023 20:24:07 +0800	[thread overview]
Message-ID: <f30dfee7-526e-07a4-baf6-6be7784beb50@linux.alibaba.com> (raw)
In-Reply-To: <ZDaSt8gW7kjfYGx5@dhcp22.suse.cz>



On 4/12/2023 7:15 PM, Michal Hocko wrote:
> On Wed 12-04-23 18:45:31, Baolin Wang wrote:
>> Now the __pageblock_pfn_to_page() is used by set_zone_contiguous(),
>> which checks whether the given zone contains holes, and uses pfn_valid()
>> to check if the end pfn is valid. However pfn_valid() can not make sure
>> the end pfn is not a hole if the size of a pageblock is larger than the
>> size of a sub-mem_section, since the struct page getting by pfn_to_page()
>> may represent a hole or an unusable page frame, which may cause incorrect
>> zone contiguous is set.
>>
>> Though another user of pageblock_pfn_to_page() in compaction seems work
>> well now, it is better to avoid scanning or touching these offline pfns.
>> So like commit 2d070eab2e82 ("mm: consider zone which is not fully
>> populated to have holes"), we should also use pfn_to_online_page() for
>> the end pfn to make sure it is a valid pfn with usable page frame.
>> Meanwhile the pfn_valid() for end pfn can be dropped now.
>>
>> Moreover we've already used pfn_to_online_page() for start pfn to make
>> sure it is online and valid, so the pfn_valid() for the start pfn is
>> unnecessary, drop it.
> 
> Is this a theoretical problem or something you have encountered on a
> real machine? Could you provide more details please?

As I replied to David, this is just from code inspection when trying to 
remove the unnecessary pfn_valid() in __pageblock_pfn_to_page().


  reply	other threads:[~2023-04-12 12:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 10:45 Baolin Wang
2023-04-12 11:15 ` Michal Hocko
2023-04-12 12:24   ` Baolin Wang [this message]
2023-04-12 11:25 ` David Hildenbrand
2023-04-12 12:16   ` Baolin Wang
2023-04-14 15:07     ` Vlastimil Babka
2023-04-19  6:47       ` Baolin Wang
2023-04-20  7:22     ` Huang, Ying
2023-04-20  9:11       ` Baolin Wang
2023-04-21  4:21         ` Huang, Ying
2023-04-21  7:13           ` Baolin Wang
2023-04-21  7:44             ` Huang, Ying

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=f30dfee7-526e-07a4-baf6-6be7784beb50@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --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