The patch titled Subject: mm: fix a regression with HIGHMEM has been added to the -mm tree. Its filename is mm-fix-a-regression-with-highmem-introduced-by-changeset-7f1290f2f2a4d.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jiang Liu <jiang.liu@xxxxxxxxxx> Subject: mm: fix a regression with HIGHMEM Changeset 7f1290f2f2 ("mm: fix-up zone present pages") tried to fix a issue when calculating zone->present_pages, but it causes a regression to 32bit systems with HIGHMEM. With that changeset, reset_zone_present_pages() resets all zone->present_pages to zero, and fixup_zone_present_pages() is called to recalculate zone->present_pages when the boot allocator frees core memory pages into the buddy allocator. Because highmem pages are not freed by bootmem allocator, all highmem zones' present_pages becomes zero. Actually there's no need to recalculate present_pages for the highmem zone because the bootmem allocator never allocates pages from it. So fix the regression by skipping highmem in function reset_zone_present_pages() and fixup_zone_present_pages(). Signed-off-by: Jiang Liu <jiang.liu@xxxxxxxxxx> Signed-off-by: Jianguo Wu <wujianguo@xxxxxxxxxx> Reported-by: Maciej Rutecki <maciej.rutecki@xxxxxxxxx> Tested-by: Maciej Rutecki <maciej.rutecki@xxxxxxxxx> Tested-by: Chris Clayton <chris2553@xxxxxxxxxxxxxx> Cc: Rafael J. Wysocki <rjw@xxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_alloc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff -puN mm/page_alloc.c~mm-fix-a-regression-with-highmem-introduced-by-changeset-7f1290f2f2a4d mm/page_alloc.c --- a/mm/page_alloc.c~mm-fix-a-regression-with-highmem-introduced-by-changeset-7f1290f2f2a4d +++ a/mm/page_alloc.c @@ -6108,7 +6108,8 @@ void reset_zone_present_pages(void) for_each_node_state(nid, N_HIGH_MEMORY) { for (i = 0; i < MAX_NR_ZONES; i++) { z = NODE_DATA(nid)->node_zones + i; - z->present_pages = 0; + if (!is_highmem(z)) + z->present_pages = 0; } } } @@ -6123,10 +6124,11 @@ void fixup_zone_present_pages(int nid, u for (i = 0; i < MAX_NR_ZONES; i++) { z = NODE_DATA(nid)->node_zones + i; + if (is_highmem(z)) + continue; + zone_start_pfn = z->zone_start_pfn; zone_end_pfn = zone_start_pfn + z->spanned_pages; - - /* if the two regions intersect */ if (!(zone_start_pfn >= end_pfn || zone_end_pfn <= start_pfn)) z->present_pages += min(end_pfn, zone_end_pfn) - max(start_pfn, zone_start_pfn); _ Patches currently in -mm which might be from jiang.liu@xxxxxxxxxx are linux-next.patch mm-fix-a-regression-with-highmem-introduced-by-changeset-7f1290f2f2a4d.patch memory_hotplug-fix-possible-incorrect-node_states.patch slub-hotplug-ignore-unrelated-nodes-hot-adding-and-hot-removing.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html