Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1709919
| From | Pasha Tatashin <pasha.tatashin@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [v6 04/15] mm: discard memblock data later |
| Date | 2017-08-11 21:10 +0200 |
| Message-ID | <udntL-7oX-3@gated-at.bofh.it> (permalink) |
| References | <ubX8m-5vB-5@gated-at.bofh.it> <ubX8m-5vB-19@gated-at.bofh.it> <udeA9-1Md-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[v6 04/15] mm: discard memblock data later Pavel Tatashin <pasha.tatashin@oracle.com> - 2017-08-07 22:50 +0200
Re: [v6 04/15] mm: discard memblock data later Michal Hocko <mhocko@kernel.org> - 2017-08-11 11:40 +0200
Re: [v6 04/15] mm: discard memblock data later Mel Gorman <mgorman@techsingularity.net> - 2017-08-11 12:00 +0200
Re: [v6 04/15] mm: discard memblock data later Pasha Tatashin <pasha.tatashin@oracle.com> - 2017-08-11 18:00 +0200
Re: [v6 04/15] mm: discard memblock data later Michal Hocko <mhocko@kernel.org> - 2017-08-11 18:10 +0200
Re: [v6 04/15] mm: discard memblock data later Pasha Tatashin <pasha.tatashin@oracle.com> - 2017-08-11 18:30 +0200
Re: [v6 04/15] mm: discard memblock data later Michal Hocko <mhocko@kernel.org> - 2017-08-14 13:40 +0200
Re: [v6 04/15] mm: discard memblock data later Pasha Tatashin <pasha.tatashin@oracle.com> - 2017-08-14 15:40 +0200
Re: [v6 04/15] mm: discard memblock data later Pasha Tatashin <pasha.tatashin@oracle.com> - 2017-08-11 21:10 +0200
Re: [v6 04/15] mm: discard memblock data later Michal Hocko <mhocko@kernel.org> - 2017-08-14 13:40 +0200
Re: [v6 04/15] mm: discard memblock data later Michal Hocko <mhocko@kernel.org> - 2017-08-14 15:50 +0200
Re: [v6 04/15] mm: discard memblock data later Pasha Tatashin <pasha.tatashin@oracle.com> - 2017-08-14 15:50 +0200
csiph-web