lkml.org 
[lkml]   [2006]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/3] swsusp: Fix mark_free_pages
From
Date
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-02 21:55    [W:0.094 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site