linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qian Cai <cai@lca.pw>
To: Michal Hocko <mhocko@suse.com>
Cc: akpm@linux-foundation.org, osalvador@suse.de,
	catalin.marinas@arm.com, vbabka@suse.cz, linux-mm@kvack.org
Subject: Re: [PATCH] mm/hotplug: invalid PFNs from pfn_to_online_page()
Date: Mon, 21 Jan 2019 12:58:46 -0500	[thread overview]
Message-ID: <3c4aa744-4a8a-08a6-bc41-ac3a722a0d17@lca.pw> (raw)
In-Reply-To: <1295f347-5a14-5b3b-23ef-2f001c25d980@lca.pw>



On 1/21/19 11:38 AM, Qian Cai wrote:
> 
> 
> On 1/21/19 4:53 AM, Michal Hocko wrote:
>> On Thu 17-01-19 21:16:50, Qian Cai wrote:
>>> On an arm64 ThunderX2 server, the first kmemleak scan would crash [1]
>>> with CONFIG_DEBUG_VM_PGFLAGS=y due to page_to_nid() found a pfn that is
>>> not directly mapped (MEMBLOCK_NOMAP). Hence, the page->flags is
>>> uninitialized.
>>>
>>> This is due to the commit 9f1eb38e0e11 ("mm, kmemleak: little
>>> optimization while scanning") starts to use pfn_to_online_page() instead
>>> of pfn_valid(). However, in the CONFIG_MEMORY_HOTPLUG=y case,
>>> pfn_to_online_page() does not call memblock_is_map_memory() while
>>> pfn_valid() does.
>>
>> How come there is an online section which has an pfn_valid==F? We do
>> allocate the full section worth of struct pages so there is a valid
>> struct page. Is there any hole inside this section?
> 
> It has CONFIG_HOLES_IN_ZONE=y.

Actually, this does not seem have anything to do with holes.

68709f45385a arm64: only consider memblocks with NOMAP cleared for linear mapping

This causes pages marked as nomap being no long reassigned to the new zone in
memmap_init_zone() by calling __init_single_page().

There is an old discussion for this topic.
https://lkml.org/lkml/2016/11/30/566

  reply	other threads:[~2019-01-21 17:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 17:36 kmemleak scan crash due to invalid PFNs Qian Cai
2019-01-17 18:50 ` Oscar Salvador
2019-01-17 18:50   ` Oscar Salvador
2019-01-17 18:58 ` Oscar Salvador
2019-01-18  2:16 ` [PATCH] mm/hotplug: invalid PFNs from pfn_to_online_page() Qian Cai
2019-01-21  9:53   ` Michal Hocko
2019-01-21 16:38     ` Qian Cai
2019-01-21 17:58       ` Qian Cai [this message]
2019-01-21 18:36         ` Michal Hocko
2019-01-21 18:19       ` Michal Hocko
2019-01-21 18:37         ` Qian Cai

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=3c4aa744-4a8a-08a6-bc41-ac3a722a0d17@lca.pw \
    --to=cai@lca.pw \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=osalvador@suse.de \
    --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