Skip to content

Commit 6e5d730

Browse files
TGSPrafaeljw
authored andcommitted
PM: hibernate: Fix mistake in kerneldoc comment
The actual maximum image size formula in hibernate_preallocate_memory() is as follows: max_size = (count - (size + PAGES_FOR_IO)) / 2 - 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE); but the one in the kerneldoc comment of the function is different and incorrect. Fixes: ddeb648 ("PM / Hibernate: Add sysfs knob to control size of memory for drivers") Signed-off-by: xiongxin <xiongxin@kylinos.cn> [ rjw: Subject and changelog rewrite ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 30a0b95 commit 6e5d730

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

kernel/power/snapshot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,8 +1723,8 @@ static unsigned long minimum_image_size(unsigned long saveable)
17231723
* /sys/power/reserved_size, respectively). To make this happen, we compute the
17241724
* total number of available page frames and allocate at least
17251725
*
1726-
* ([page frames total] + PAGES_FOR_IO + [metadata pages]) / 2
1727-
* + 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE)
1726+
* ([page frames total] - PAGES_FOR_IO - [metadata pages]) / 2
1727+
* - 2 * DIV_ROUND_UP(reserved_size, PAGE_SIZE)
17281728
*
17291729
* of them, which corresponds to the maximum size of a hibernation image.
17301730
*

0 commit comments

Comments
 (0)