From: Dave Hansen <haveblue@us.ibm.com>
To: ncunningham@cyclades.com
Cc: Pavel Machek <pavel@ucw.cz>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Free swap suspend from dependency on PageReserved
Date: Wed, 05 Oct 2005 15:03:32 -0700 [thread overview]
Message-ID: <1128549812.18249.8.camel@localhost> (raw)
In-Reply-To: <1128546263.10363.14.camel@localhost>
On Thu, 2005-10-06 at 07:04 +1000, Nigel Cunningham wrote:
>
> + for (tmp = 0; tmp < max_low_pfn; tmp++, addr += PAGE_SIZE) {
> + if (page_is_ram(tmp)) {
> + /*
> + * Only count reserved RAM pages
> + */
> + if (PageReserved(mem_map+tmp))
> + reservedpages++;
Please don't reference mem_map[] directly outside of #ifdef
CONFIG_FLATMEM areas. It is not defined for all config cases. Please
use pfn_to_page(), instead. It should work in all cases where the page
is valid.
Also, instead of keeping addr defined like you do, and comparing it
during each run of the loop, why not just use pfn_is_nosave(), which is
already defined? Then, you won't even need the variable.
-- Dave
next prev parent reply other threads:[~2005-10-05 22:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-05 21:04 [PATCH] Free swap suspend from dependency on PageReserved Nigel Cunningham
2005-10-05 22:03 ` Dave Hansen [this message]
2005-10-05 22:24 ` Nigel Cunningham
2005-10-06 8:28 ` Rafael J. Wysocki
2005-10-06 10:14 ` Nick Piggin
2005-10-07 5:33 ` Nigel Cunningham
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=1128549812.18249.8.camel@localhost \
--to=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ncunningham@cyclades.com \
--cc=pavel@ucw.cz \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).