Re: [RFC][patch 0/2] mm: remove PageReserved

Pavel Machek
2005-08-10T21:50:22Z

Hi!

> > Swsusp is the main "is valid ram" user I have in mind here. It
> > wants to know whether or not it should save and restore the
> > memory of a given `struct page`.
>
> Why can't it follow the rmap chain?

It is walking physical memory, not memory managment chains. I need
something like:

static int saveable(struct zone * zone, unsigned long * zone_pfn)
{
unsigned long pfn = *zone_pfn + zone->zone_start_pfn;
struct page * page;

if (!pfn_valid(pfn))
return 0;

page = pfn_to_page(pfn);
BUG_ON(PageReserved(page) && PageNosave(page));
if (PageNosave(page))
return 0;
if (PageReserved(page) && pfn_is_nosave(pfn)) {
pr_debug("[nosave pfn 0x%lx]", pfn);
return 0;
}
if (PageNosaveFree(page))
return 0;

return 1;
}
Pavel
--
if you have sharp zaurus hardware you don't need... you know my address