lkml.org 
[lkml]   [2012]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v10]: Hibernation: fix the number of pages used for hibernate/thaw buffering
2012-04-12 13:31, Bojan Smojver skrev:
> Bojan Smojver <bojan@rexursive.com> wrote:
>
>> - read_pages = (nr_free_pages() - snapshot_get_image_size()) >> 1;
>> + read_pages = (low_free_pages() - snapshot_get_image_size()) / 2;
>
> Actually, I am pretty sure this part of the patch is wrong. Image can
> be bigger than the size of non-high memory. So, this calculation may
> turn up entirely bogus numbers, given we are dealing with unsigned
> values. Sure, we clamp that a line later, so all is not lost, but
> still, it needs to be fixed.

Indeed. I think what you want is:

read_pages = min(low_free_pages(),
nr_free_pages() - snapshot_get_image_size()) / 2;

--
Pelle


\
 
 \ /
  Last update: 2012-04-12 18:41    [W:0.073 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site