[PATCH] powerpc/pseries hotplug: prevent the reserved mem from removing

Hari Bathini hbathini at linux.vnet.ibm.com
Wed May 3 04:37:48 AEST 2017


On Friday 28 April 2017 09:59 AM, Liu ping fan wrote:
> On Fri, Apr 28, 2017 at 2:06 AM, Hari Bathini
> <hbathini at linux.vnet.ibm.com> wrote:
>> Hi Pingfan,
>>
>>
>> On Thursday 27 April 2017 01:13 PM, Pingfan Liu wrote:
>>> E.g after fadump reserves mem regions, these regions should not be removed
>>> before fadump explicitly free them.
>>> Signed-off-by: Pingfan Liu <piliu at redhat.com>
>>> ---
>>>    arch/powerpc/platforms/pseries/hotplug-memory.c | 5 +++--
>>>    1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c
>>> b/arch/powerpc/platforms/pseries/hotplug-memory.c
>>> index e104c71..201be23 100644
>>> --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
>>> +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
>>> @@ -346,6 +346,8 @@ static int pseries_remove_memblock(unsigned long base,
>>> unsigned int memblock_siz
>>>
>>>          if (!pfn_valid(start_pfn))
>>>                  goto out;
>>> +       if (memblock_is_reserved(base))
>>> +               return -EINVAL;
>>
>> I think memblock reserved regions are not hot removed even without this
>> patch.
>> So, can you elaborate on when/why this patch is needed?
>>
> I have not found code to prevent the reserved regions from free. Do I
> miss anything?

IIUC, during hot-remove,  while trying to offline reserved pages, it 
reports -EBUSY
thus failing to remove a lmb that has reserved memory. I was wondering 
if there would
be a case where that doesn't happen and this patch is necessary..

Thanks
Hari



More information about the Linuxppc-dev mailing list