From: Johannes Weiner Date: Fri, 23 May 2008 20:04:21 +0000 (-0700) Subject: mm: don't drop a partial page in a zone's memory map size X-Git-Tag: Ubuntu-5.13.0-19.19~42045 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=f7232154198f928fc25f420d6190468212a7632a;p=mirror_ubuntu-jammy-kernel.git mm: don't drop a partial page in a zone's memory map size In a zone's present pages number, account for all pages occupied by the memory map, including a partial. Signed-off-by: Johannes Weiner Cc: KAMEZAWA Hiroyuki Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 63835579323a..035300299f94 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3378,7 +3378,8 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat, * is used by this zone for memmap. This affects the watermark * and per-cpu initialisations */ - memmap_pages = (size * sizeof(struct page)) >> PAGE_SHIFT; + memmap_pages = + PAGE_ALIGN(size * sizeof(struct page)) >> PAGE_SHIFT; if (realsize >= memmap_pages) { realsize -= memmap_pages; printk(KERN_DEBUG