]> git.itanic.dy.fi Git - linux-stable/commitdiff
PM / Hibernate: Improve comments in hibernate_preallocate_memory()
authorRafael J. Wysocki <rjw@sisk.pl>
Mon, 20 Sep 2010 17:44:38 +0000 (19:44 +0200)
committerAK <andi@firstfloor.org>
Thu, 31 Mar 2011 18:58:51 +0000 (11:58 -0700)
[ upstream commit 266f1a25eff5ff98c498d7754a419aacfd88f71c ]

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: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
kernel/power/snapshot.c

index 1a9b3260733932c3ef4238fee9c2d4ed709d653a..f2f61fa7eb99f1e0e050a43db96d48eb515cb1a8 100644 (file)
@@ -1318,12 +1318,14 @@ int hibernate_preallocate_memory(void)
 
        /* Compute the maximum number of saveable pages to leave in memory. */
        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);
        if (size > max_size)
                size = max_size;
        /*
-        * If the maximum is not less than the current number of saveable pages
-        * in memory, allocate page frames for the image and we're done.
+        * If the desired number of image pages is at least as large as the
+        * current number of saveable pages in memory, allocate page frames for
+        * the image and we're done.
         */
        if (size >= saveable) {
                pages = preallocate_image_highmem(save_highmem);