Thread (53 messages) 53 messages, 9 authors, 2008-11-07

Re: [linux-pm] [PATCH] hibernation should work ok with memory hotplug

From: Dave Hansen <hidden>
Date: 2008-11-04 07:09:46
Also in: linux-mm, lkml

On Tue, 2008-11-04 at 15:02 +1100, Nigel Cunningham wrote:
On Mon, 2008-11-03 at 14:34 -0800, Dave Hansen wrote:
quoted
A node might have a node_start_pfn=0 and a node_end_pfn=100 (and it may
have only one zone).  But, there may be another node with
node_start_pfn=10 and a node_end_pfn=20.  This loop:

        for_each_zone(zone) {
              ...
                for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++)
                        if (page_is_saveable(zone, pfn))
                                memory_bm_set_bit(orig_bm, pfn);
        }

will walk over the smaller node's pfn range multiple times.  Is this OK?

I think all you have to do to fix it is check page_zone(page) == zone
and skip out if they don't match.
So pfn 10 in the first node refers to the same memory as pfn 10 in the
second node?
Sure.  But, remember that the pfns (and the entire physical address
space) is consistent across the entire system.  It's not like both nodes
have an address and the kernel only "gives" it to one of them.

There's real confusion about zone->zone_start/end_pfn, I think.  *All*
that they mean is this:

- zone_start_pfn is the lowest physical address present in the zone. 
- zone_end_pfn is the highest physical address present in the zone

That's *it*.  Those numbers imply *nothing* about the pages between
them, except that there might be 0 or more pages in there belonging to
the same zone.

"All pages in this zone lie between these two physical addresses." is
all they say.

-- Dave
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help