mm: fix set pageblock migratetype when boot
Subsystems (2)
PATCH 1/1 mm: fix set pageblock migratetype when boot
memmap_init_zone()
... if ((z->zone_start_pfn <= pfn) && (pfn < zone_end_pfn(z)) && !(pfn & (pageblock_nr_pages - 1))) set_pageblock_migratetype(page, MIGRATE_MOVABLE); ...
If the pfn does not align to pageblock, it will not init the migratetype. So call it for every page, it will takes more time, but it doesn't matter, this function will be called only in boot or hotadd memory.
e.g.
[ 223.679446] node 0: [mem 0x00001000-0x00099fff] [ 223.679449] node 0: [mem 0x00100000-0xbf78ffff] [ 223.680486] node 0: [mem 0x100000000-0x27fffffff]
--- mm/page_alloc.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
mm/page_alloc.c +1 -2
@@ -4210,8 +4210,7 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,* pfn out of zone. */ if ((z->zone_start_pfn <= pfn) - && (pfn <zone_end_pfn (z)) - && !(pfn & (pageblock_nr_pages -1 ))) + && (pfn <zone_end_pfn (z)))set_pageblock_migratetype (page,MIGRATE_MOVABLE );INIT_LIST_HEAD (&page->lru);
Signature · 1 line
1.7.1
Quoted 9 lines · Xishi Qiu
memmap_init_zone()... if ((z->zone_start_pfn <= pfn) && (pfn < zone_end_pfn(z)) && !(pfn & (pageblock_nr_pages - 1))) set_pageblock_migratetype(page, MIGRATE_MOVABLE); ...If the pfn does not align to pageblock, it will not init the migratetype.
What important impact does that have? It should leave a partial pageblock as MIGRATE_UNMOVABLE which is fine by me.
Quoted 3 lines
So call it for every page, it will takes more time, but it doesn't matter, this function will be called only in boot or hotadd memory.
It's a lot of additional overhead to add to memory initialisation. It would need to be for an excellent reason with no alternative solution.
Signature · 8 lines
Mel Gorman SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 9 lines · Mel Gorman
Quoted 8 lines · Xishi Qiu
memmap_init_zone()... if ((z->zone_start_pfn <= pfn) && (pfn < zone_end_pfn(z)) && !(pfn & (pageblock_nr_pages - 1))) set_pageblock_migratetype(page, MIGRATE_MOVABLE); ...
Quoted 5 lines
Quoted 1 line
If the pfn does not align to pageblock, it will not init the migratetype.
What important impact does that have? It should leave a partial pageblock as
MIGRATE_UNMOVABLEwhich is fine by me.
Hi Mel,
The impact is less, it's OK to ignore it.
Thanks,
Xishi Qiu
Quoted 7 lines
Quoted 3 lines
So call it for every page, it will takes more time, but it doesn't matter, this function will be called only in boot or hotadd memory.
It's a lot of additional overhead to add to memory initialisation. It would need to be for an excellent reason with no alternative solution.