lkml.org 
[lkml]   [2019]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V8 2/2] arm64/mm: Enable memory hot remove
From
Date


On 09/23/2019 04:47 PM, Matthew Wilcox wrote:
> On Mon, Sep 23, 2019 at 11:13:45AM +0530, Anshuman Khandual wrote:
>> +#ifdef CONFIG_MEMORY_HOTPLUG
>> +static void free_hotplug_page_range(struct page *page, size_t size)
>> +{
>> + WARN_ON(!page || PageReserved(page));
>
> WARN_ON(!page) isn't terribly useful. You're going to crash on the very
> next line when you call page_address() anyway. If this line were
>
> if (WARN_ON(!page || PageReserved(page)))
> return;
>
> it would make sense, or if it were just
>
> WARN_ON(PageReserved(page))
>
> it would also make sense.

I guess WARN_ON(PageReserved(page)) should be good enough to make sure
that page being freed here was originally allocated at runtime for a
previous memory hot add operation and did not some how come from the
memblock reserved area. That was the original objective for this check.
Will change it.

>
>> + free_pages((unsigned long)page_address(page), get_order(size));
>> +}
>

\
 
 \ /
  Last update: 2019-09-24 10:41    [W:0.058 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site