X-Git-Url: https://git.stricted.de/?p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git;a=blobdiff_plain;f=mm%2Fnobootmem.c;fp=mm%2Fnobootmem.c;h=03d152a76acf5e18396b74e62a3372e55b469750;hp=ecc2f13d557d3b28f5bb82b3d5dca2e621cfcf9c;hb=de65d816aa44f9ddd79861ae21d75010cc1fd003;hpb=9710f581bb4c35589ac046b0cfc0deb7f369fc85 diff --git a/mm/nobootmem.c b/mm/nobootmem.c index ecc2f13d557d..03d152a76acf 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c @@ -137,6 +137,22 @@ unsigned long __init free_low_memory_core_early(int nodeid) return count; } +static void reset_node_lowmem_managed_pages(pg_data_t *pgdat) +{ + struct zone *z; + + /* + * In free_area_init_core(), highmem zone's managed_pages is set to + * present_pages, and bootmem allocator doesn't allocate from highmem + * zones. So there's no need to recalculate managed_pages because all + * highmem pages will be managed by the buddy system. Here highmem + * zone also includes highmem movable zone. + */ + for (z = pgdat->node_zones; z < pgdat->node_zones + MAX_NR_ZONES; z++) + if (!is_highmem(z)) + z->managed_pages = 0; +} + /** * free_all_bootmem - release free pages to the buddy allocator * @@ -144,6 +160,11 @@ unsigned long __init free_low_memory_core_early(int nodeid) */ unsigned long __init free_all_bootmem(void) { + struct pglist_data *pgdat; + + for_each_online_pgdat(pgdat) + reset_node_lowmem_managed_pages(pgdat); + /* * We need to use MAX_NUMNODES instead of NODE_DATA(0)->node_id * because in some case like Node0 doesn't have RAM installed