[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <48340e96-7e6b-736f-9e23-d3111b915b6e@redhat.com>
Date: Thu, 1 Aug 2019 11:18:42 +0200
From: David Hildenbrand <david@...hat.com>
To: Michal Hocko <mhocko@...nel.org>
Cc: Rashmica Gupta <rashmica.g@...il.com>,
Oscar Salvador <osalvador@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
pasha.tatashin@...een.com, Jonathan.Cameron@...wei.com,
anshuman.khandual@....com, Vlastimil Babka <vbabka@...e.cz>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 0/5] Allocate memmap from hotadded memory
On 01.08.19 09:48, Michal Hocko wrote:
> On Thu 01-08-19 09:39:57, Michal Hocko wrote:
>> On Thu 01-08-19 09:31:09, David Hildenbrand wrote:
>>> On 01.08.19 09:26, David Hildenbrand wrote:
>> [...]
>>>> I am not sure about the implications of having
>>>> pfn_valid()/pfn_present()/pfn_online() return true but accessing it
>>>> results in crashes. (suspend, kdump, whatever other technology touches
>>>> online memory)
>>>
>>> (oneidea: we could of course go ahead and mark the pages PG_offline
>>> before unmapping the pfn range to work around these issues)
>>
>> PG_reserved and an elevated reference count should be enough to drive
>> any pfn walker out. Pfn walkers shouldn't touch any page unless they
>> know and recognize their type.
>
> Btw. this shouldn't be much different from DEBUG_PAGE_ALLOC in
> principle. The memory is valid, but not mapped to the kernel virtual
> space. Nobody should be really touching it anyway.
>
I guess that could work (I am happy with anything that gets rid of
offline_pages()/device_online() here :D ).
So for each node, alloc_contig_range() (if I remember correctly, all
pages in the range have to be in the same zone), set them PG_reserved (+
maybe something else, we'll have to see). Then, unmap them.
The reverse when freeing the memory. Guess this should leave the current
user space interface unmodified.
I can see that guard pages use a special page type (PageGuard), not sure
if something like that is really required. We'll have to see.
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists