Skip to content

Commit 160cb5a

Browse files
Namhyung Kimrjwysocki
authored andcommitted
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>
1 parent 5eb6f9a commit 160cb5a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎kernel/power/snapshot.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,8 @@ unsigned int snapshot_additional_pages(struct zone *zone)
812812
unsigned int res;
813813

814814
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);
816817
return 2 * res;
817818
}
818819

0 commit comments

Comments
 (0)