Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM / Hibernate: Correct additional pages number calculation

The struct bm_block is allocated by chain_alloc(),
so it'd better counting it in LINKED_PAGE_DATA_SIZE.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

authored by

Namhyung Kim and committed by
Rafael J. Wysocki
160cb5a9 5eb6f9ad

+2 -1
+2 -1
kernel/power/snapshot.c
··· 812 812 unsigned int res; 813 813 814 814 res = DIV_ROUND_UP(zone->spanned_pages, BM_BITS_PER_BLOCK); 815 - res += DIV_ROUND_UP(res * sizeof(struct bm_block), PAGE_SIZE); 815 + res += DIV_ROUND_UP(res * sizeof(struct bm_block), 816 + LINKED_PAGE_DATA_SIZE); 816 817 return 2 * res; 817 818 } 818 819