Re: [PATCH v10]: Hibernation: fix the number of pages used for hibernate/thaw buffering

From: Bojan Smojver
Date: Thu Apr 12 2012 - 07:31:17 EST


Bojan Smojver <bojan@xxxxxxxxxxxxx> 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.

Will have a better version for you tomorrow.

--
Bojan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/