mm: Remove the highmem zones' memmap in the highmem zone
Subsystems (2)
PATCH 1/1 mm: Remove the highmem zones' memmap in the highmem zone
From: Zhong Hongbo <[email protected]>
Since the commit 01cefaef40c4 ("mm: provide more accurate estimation of pages occupied by memmap") allocate the pages from lowmem for the highmem zones' memmap. So It is not need to reserver the memmap's for the highmem.
A 2G DDR3 for the arm platform:
On node 0 totalpages: 524288free_area_init_node: node 0, pgdat 80ccd380, node_mem_map 80d38000
DMA zone: 3568 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 456704 pages, LIFO batch:31
HighMem zone: 528 pages used for memmap
HighMem zone: 67584 pages, LIFO batch:15
On node 0 totalpages: 524288free_area_init_node: node 0, pgdat 80cd6f40, node_mem_map 80d42000
DMA zone: 3568 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 456704 pages, LIFO batch:31
HighMem zone: 67584 pages, LIFO batch:15
--- mm/page_alloc.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
mm/page_alloc.c +12 -10
@@ -4851,16 +4851,18 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,* and per-cpu initialisations */ memmap_pages =calc_memmap_size (size, realsize); -if (freesize >= memmap_pages) { - freesize -= memmap_pages; -if (memmap_pages) -printk (KERN_DEBUG -" %s zone: %lu pages used for memmap\n" , - zone_names[j], memmap_pages); - }else -printk (KERN_WARNING -" %s zone: %lu pages exceeds freesize %lu\n" , - zone_names[j], memmap_pages, freesize); +if (!is_highmem_idx (j)) { +if (freesize >= memmap_pages) { + freesize -= memmap_pages; +if (memmap_pages) +printk (KERN_DEBUG +" %s zone: %lu pages used for memmap\n" , + zone_names[j], memmap_pages); + }else +printk (KERN_WARNING +" %s zone: %lu pages exceeds freesize %lu\n" , + zone_names[j], memmap_pages, freesize); + }/* Account for reserved pages */ if (j ==0 && freesize > dma_reserve) {
Signature · 1 line
1.7.9.5
Andrew Morton
maintainerQuoted 6 lines · On Thu, 27 Nov 2014 18:46:34 +0800 Hongbo Zhong <[email protected]> wrote:
From: Zhong Hongbo <[email protected]>
Since the commit
01cefaef40c4("mm: provide more accurate estimation of pages occupied by memmap") allocate the pages from lowmem for the highmem zones' memmap. So It is not need to reserver the memmap's for the highmem.
Looks right.
Quoted 9 lines
A 2G DDR3 for the arm platform:
On node 0 totalpages: 524288free_area_init_node: node 0, pgdat80ccd380,node_mem_map80d38000
DMA zone: 3568 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 456704 pages, LIFO batch:31
HighMem zone: 528 pages used for memmap
HighMem zone: 67584 pages, LIFO batch:15
Quoted 6 lines
On node 0 totalpages: 524288
free_area_init_node: node 0, pgdat80cd6f40,node_mem_map80d42000
DMA zone: 3568 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 456704 pages, LIFO batch:31
HighMem zone: 67584 pages, LIFO batch:15
So nothing changed. Maybe it would have if the machine had more highmem.
I'm trying to work out what effect this patch actually has. AFAICT it provides more accurate values for zone->min_unmapped_pages and zone->min_slab_pages on NUMA. Anything else?