lkml.org 
[lkml]   [2017]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [v6 04/15] mm: discard memblock data later
From
Date
Hi Michal,

This suggestion won't work, because there are arches without memblock
support: tile, sh...

So, I would still need to have:

#ifdef CONFIG_MEMBLOCK in page_alloc, or define memblock_discard() stubs
in nobootmem headfile. In either case it would become messier than what
it is right now.

Pasha

> I have just one nit below
> Acked-by: Michal Hocko <mhocko@suse.com>
>
> [...]
>> diff --git a/mm/memblock.c b/mm/memblock.c
>> index 2cb25fe4452c..bf14aea6ab70 100644
>> --- a/mm/memblock.c
>> +++ b/mm/memblock.c
>> @@ -285,31 +285,27 @@ static void __init_memblock memblock_remove_region(struct memblock_type *type, u
>> }
>>
>> #ifdef CONFIG_ARCH_DISCARD_MEMBLOCK
>
> pull this ifdef inside memblock_discard and you do not have an another
> one in page_alloc_init_late
>
> [...]
>> +/**
>> + * Discard memory and reserved arrays if they were allocated
>> + */
>> +void __init memblock_discard(void)
>> {
>
> here
>
>> - if (memblock.memory.regions == memblock_memory_init_regions)
>> - return 0;
>> + phys_addr_t addr, size;
>>
>> - *addr = __pa(memblock.memory.regions);
>> + if (memblock.reserved.regions != memblock_reserved_init_regions) {
>> + addr = __pa(memblock.reserved.regions);
>> + size = PAGE_ALIGN(sizeof(struct memblock_region) *
>> + memblock.reserved.max);
>> + __memblock_free_late(addr, size);
>> + }
>>
>> - return PAGE_ALIGN(sizeof(struct memblock_region) *
>> - memblock.memory.max);
>> + if (memblock.memory.regions == memblock_memory_init_regions) {
>> + addr = __pa(memblock.memory.regions);
>> + size = PAGE_ALIGN(sizeof(struct memblock_region) *
>> + memblock.memory.max);
>> + __memblock_free_late(addr, size);
>> + }
>> }
>> -
>> #endif

\
 
 \ /
  Last update: 2017-08-11 21:03    [W:0.090 / U:2.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site