mm: Add total_unmovable_pages global variable
Vmalloc will exit if the amount it needs to allocate is greater than totalram_pages. Vmalloc cannot allocate from the movable zone, so pages in the movable zone should not be counted. This change adds a new global variable: total_unmovable_pages. It is calculated in init.c, based on totalram_pages minus the pages in the movable zone. Vmalloc now looks at this new global instead of totalram_pages. total_unmovable_pages can be modified during memory_hotplug. If the zone you are offlining/onlining is unmovable, then you modify it similar to totalram_pages. If the zone is movable, then no change is needed. Change-Id: Ie55c41051e9ad4b921eb04ecbb4798a8bd2344d6 Signed-off-by: Jack Cheung <jackc@codeaurora.org> (cherry picked from commit 59f9f1c9ae463a3d4499cd9353619f8b1993371b) Conflicts: arch/arm/mm/init.c mm/memory_hotplug.c mm/page_alloc.c mm/vmalloc.c
This commit is contained in:
committed by
Stephen Boyd
parent
18e44d3eaf
commit
f6e34be773
@@ -31,6 +31,9 @@ extern unsigned long max_mapnr;
|
||||
|
||||
extern unsigned long num_physpages;
|
||||
extern unsigned long totalram_pages;
|
||||
#ifdef CONFIG_FIX_MOVABLE_ZONE
|
||||
extern unsigned long total_unmovable_pages;
|
||||
#endif
|
||||
extern void * high_memory;
|
||||
extern int page_cluster;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user