All of lore.kernel.org
 help / color / mirror / Atom feed
From: Per Olofsson <pelle@debian.org>
To: Bojan Smojver <bojan@rexursive.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v10]: Hibernation: fix the number of pages used for hibernate/thaw buffering
Date: Thu, 12 Apr 2012 18:30:15 +0200	[thread overview]
Message-ID: <4F870317.1030408@debian.org> (raw)
In-Reply-To: <b84d15d8-f35b-4296-927b-86a722541072@email.android.com>

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

  reply	other threads:[~2012-04-12 16:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 10:08 [PATCH v10]: Hibernation: fix the number of pages used for hibernate/thaw buffering Bojan Smojver
2012-04-12 11:31 ` Bojan Smojver
2012-04-12 16:30   ` Per Olofsson [this message]
2012-04-12 21:30     ` Bojan Smojver
2012-04-15 12:46       ` Per Olofsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F870317.1030408@debian.org \
    --to=pelle@debian.org \
    --cc=bojan@rexursive.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.