[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1154548279.7232.34.camel@localhost.localdomain>
Date: Wed, 02 Aug 2006 12:51:18 -0700
From: Dave Hansen <haveblue@...ibm.com>
To: "Rafael J. Wysocki" <rjw@...k.pl>
Cc: Andrew Morton <akpm@...l.org>, LKML <linux-kernel@...r.kernel.org>,
Pavel Machek <pavel@....cz>
Subject: Re: [PATCH 1/3] swsusp: Fix mark_free_pages
On Wed, 2006-08-02 at 18:48 +0200, Rafael J. Wysocki wrote:
> + max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages;
> + for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) {
> + struct page *page = pfn_to_page(pfn);
> +
> + if (!PageNosave(page))
> + ClearPageNosaveFree(page);
> + }
This is certainly not the only place in swsusp where there is a bug like
this, but it is not correct to assume that each page inside of a zone is
valid. With sparsemem, you need to do pfn_valid() on each pfn before
calling pfn_to_page().
Something like:
max_zone_pfn = zone->zone_start_pfn + zone->spanned_pages;
for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) {
struct page *page;
if (!pfn_valid(pfn))
continue;
page = pfn_to_page(pfn);
if (!PageNosave(page))
ClearPageNosaveFree(page);
}
-- Dave
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists