Mark Nelson 91eea67c6d powerpc/mm: Track backing pages allocated by vmemmap_populate()
We need to keep track of the backing pages that get allocated by
vmemmap_populate() so that when we use kdump, the dump-capture kernel knows
where these pages are.

We use a simple linked list of structures that contain the physical address
of the backing page and corresponding virtual address to track the backing
pages.
To save space, we just use a pointer to the next struct vmemmap_backing. We
can also do this because we never remove nodes.  We call the pointer "list"
to be compatible with changes made to the crash utility.

vmemmap_populate() is called either at boot-time or on a memory hotplug
operation. We don't have to worry about the boot-time calls because they
will be inherently single-threaded, and for a memory hotplug operation
vmemmap_populate() is called through:
sparse_add_one_section()
            |
            V
kmalloc_section_memmap()
            |
            V
sparse_mem_map_populate()
            |
            V
vmemmap_populate()
and in sparse_add_one_section() we're protected by pgdat_resize_lock().
So, we don't need a spinlock to protect the vmemmap_list.

We allocate space for the vmemmap_backing structs by allocating whole pages
in vmemmap_list_alloc() and then handing out chunks of this to
vmemmap_list_populate().

This means that we waste at most just under one page, but this keeps the code
is simple.

Signed-off-by: Mark Nelson <markn@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-05-06 16:49:27 +10:00
..
2010-05-05 09:11:10 -04:00
2010-02-01 14:00:30 +11:00
2009-09-08 17:53:04 -07:00
2009-12-10 20:08:15 -06:00
2008-08-18 21:40:03 +02:00
2008-08-04 13:18:17 +10:00
2010-03-01 12:36:06 -03:00
2010-03-01 12:35:55 -03:00
2009-12-09 17:09:33 +11:00
2010-05-05 09:11:10 -04:00
2010-05-05 09:11:10 -04:00
2009-10-30 17:21:28 +11:00
2010-03-09 11:52:52 +11:00
2010-03-05 03:04:08 -06:00
2010-03-05 03:04:08 -06:00
2009-04-07 15:18:58 +10:00
2009-12-09 17:10:37 +11:00
2010-05-05 09:11:10 -04:00
2010-03-05 03:04:08 -06:00
2008-10-15 11:31:54 +11:00
2008-09-06 19:30:15 +01:00
2009-04-01 08:59:16 -07:00
2009-08-28 14:24:10 +10:00
2010-03-12 15:52:32 -08:00