From: Oscar Salvador <osalvador@suse.de>
To: David Hildenbrand <david@redhat.com>
Cc: akpm@linux-foundation.org, dan.j.williams@intel.com,
pasha.tatashin@soleen.com, mhocko@suse.com,
anshuman.khandual@arm.com, Jonathan.Cameron@huawei.com,
vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/5] mm: Introduce a new Vmemmap page-type
Date: Fri, 26 Jul 2019 12:11:40 +0200 [thread overview]
Message-ID: <20190726101136.GA26721@linux> (raw)
In-Reply-To: <dbd19aea-fe18-ec42-7932-f03109cb399e@redhat.com>
On Fri, Jul 26, 2019 at 11:41:46AM +0200, David Hildenbrand wrote:
> > static void __meminit __init_single_page(struct page *page, unsigned long pfn,
> > unsigned long zone, int nid)
> > {
> > if (PageVmemmap(page))
> > /*
> > * Vmemmap pages need to preserve their state.
> > */
> > goto preserve_state;
>
> Can you be sure there are no false positives? (if I remember correctly,
> this memory might be completely uninitialized - I might be wrong)
Normal pages reaching this point will be uninitialized or
poisoned-initialized.
Vmemmap pages are initialized to 0 in mhp_mark_vmemmap_pages,
before reaching here.
For the false positive to be effective, page should be reserved, and
page->type would have to have a specific value.
If we feel unsure about this, I could add a new kind of check for only
this situation, where we initialize another field of struct page
to another specific/magic value, so we will have three checks only at
this stage.
>
> >
> > mm_zero_struct_page(page);
> > page_mapcount_reset(page);
> > INIT_LIST_HEAD(&page->lru);
> > preserve_state:
> > init_page_count(page);
> > set_page_links(page, zone, nid, pfn);
> > page_cpupid_reset_last(page);
> > page_kasan_tag_reset(page);
> >
> > So, vmemmap pages will fall within the same zone as the range we are adding,
> > that does not change.
>
> I wonder if that is the right thing to do, hmmmm, because they are
> effectively not part of that zone (not online)
>
> Will have a look at the details :)
I might be wrong here, but last time I checked, pages that are used for memmaps
at boot time (not hotplugged), are still linked to some zone.
Will have to double check though.
If that is not case, it would be easier, but I am afraid it is.
--
Oscar Salvador
SUSE L3
next prev parent reply other threads:[~2019-07-26 10:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 16:02 [PATCH v3 0/5] Allocate memmap from hotadded memory Oscar Salvador
2019-07-25 16:02 ` [PATCH v3 1/5] mm,memory_hotplug: Introduce MHP_MEMMAP_ON_MEMORY Oscar Salvador
2019-07-26 8:34 ` David Hildenbrand
2019-07-26 9:29 ` Oscar Salvador
2019-07-26 9:37 ` David Hildenbrand
2019-07-25 16:02 ` [PATCH v3 2/5] mm: Introduce a new Vmemmap page-type Oscar Salvador
2019-07-26 8:48 ` David Hildenbrand
2019-07-26 9:25 ` Oscar Salvador
2019-07-26 9:41 ` David Hildenbrand
2019-07-26 10:11 ` Oscar Salvador [this message]
2019-07-25 16:02 ` [PATCH v3 3/5] mm,sparse: Add SECTION_USE_VMEMMAP flag Oscar Salvador
2019-08-01 14:45 ` David Hildenbrand
2019-07-25 16:02 ` [PATCH v3 4/5] mm,memory_hotplug: Allocate memmap from the added memory range for sparse-vmemmap Oscar Salvador
2019-08-01 15:04 ` David Hildenbrand
2019-07-25 16:02 ` [PATCH v3 5/5] mm,memory_hotplug: Allow userspace to enable/disable vmemmap Oscar Salvador
2019-08-01 15:07 ` David Hildenbrand
2019-07-25 16:56 ` [PATCH v3 0/5] Allocate memmap from hotadded memory David Hildenbrand
2019-08-01 7:39 ` Oscar Salvador
2019-08-01 8:17 ` David Hildenbrand
2019-08-01 8:39 ` Oscar Salvador
2019-08-01 8:44 ` David Hildenbrand
2019-08-01 18:46 ` 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=20190726101136.GA26721@linux \
--to=osalvador@suse.de \
--cc=Jonathan.Cameron@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=anshuman.khandual@arm.com \
--cc=dan.j.williams@intel.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=pasha.tatashin@soleen.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;
as well as URLs for NNTP newsgroup(s).