Commit 266f1a25 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM / Hibernate: Improve comments in hibernate_preallocate_memory()

One comment in hibernate_preallocate_memory() is wrong, so fix it and
add one more comment to clarify the meaning of the fixed one.
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent bcb5ba8b
...@@ -1318,12 +1318,14 @@ int hibernate_preallocate_memory(void) ...@@ -1318,12 +1318,14 @@ int hibernate_preallocate_memory(void)
/* Compute the maximum number of saveable pages to leave in memory. */ /* Compute the maximum number of saveable pages to leave in memory. */
max_size = (count - (size + PAGES_FOR_IO)) / 2 - 2 * SPARE_PAGES; max_size = (count - (size + PAGES_FOR_IO)) / 2 - 2 * SPARE_PAGES;
/* Compute the desired number of image pages specified by image_size. */
size = DIV_ROUND_UP(image_size, PAGE_SIZE); size = DIV_ROUND_UP(image_size, PAGE_SIZE);
if (size > max_size) if (size > max_size)
size = max_size; size = max_size;
/* /*
* If the maximum is not less than the current number of saveable pages * If the desired number of image pages is at least as large as the
* in memory, allocate page frames for the image and we're done. * current number of saveable pages in memory, allocate page frames for
* the image and we're done.
*/ */
if (size >= saveable) { if (size >= saveable) {
pages = preallocate_image_highmem(save_highmem); pages = preallocate_image_highmem(save_highmem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment