Commit f7232154198f928fc25f420d6190468212a7632a

Authored by Johannes Weiner
Committed by Linus Torvalds
1 parent f899b0adc6

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 <hannes@saeurebad.de>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff

... ... @@ -3378,7 +3378,8 @@
3378 3378 * is used by this zone for memmap. This affects the watermark
3379 3379 * and per-cpu initialisations
3380 3380 */
3381   - memmap_pages = (size * sizeof(struct page)) >> PAGE_SHIFT;
  3381 + memmap_pages =
  3382 + PAGE_ALIGN(size * sizeof(struct page)) >> PAGE_SHIFT;
3382 3383 if (realsize >= memmap_pages) {
3383 3384 realsize -= memmap_pages;
3384 3385 printk(KERN_DEBUG