android_kernel_xiaomi_sdm845/arch/powerpc
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
..
boot powerpc/4xx: Simple platform for the ISS 4xx simulator 2010-05-05 11:11:56 -04:00
configs powerpc/47x: defconfig for 476 on the iss 4xx simulator 2010-05-05 11:18:45 -04:00
include/asm powerpc/mm: Track backing pages allocated by vmemmap_populate() 2010-05-06 16:49:27 +10:00
kernel powerpc/4xx: Simple platform for the ISS 4xx simulator 2010-05-05 11:11:56 -04:00
kvm include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
lib powerpc: Fix handling of strncmp with zero len 2010-04-07 18:00:39 +10:00
math-emu powerpc/math-emu: Fix efp dependence 2009-03-11 06:00:08 -05:00
mm powerpc/mm: Track backing pages allocated by vmemmap_populate() 2010-05-06 16:49:27 +10:00
oprofile include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
platforms powerpc/pseries: Only call start-cpu when a CPU is stopped 2010-05-06 16:49:25 +10:00
sysdev powerpc/4xx: Add optional "reset_type" property to control reboot via dts 2010-05-05 12:51:54 -04:00
xmon powerpc: Mark some variables in the page fault path __read_mostly 2010-02-03 17:39:48 +11:00
Kconfig powerpc: Add kprobe-based event tracer 2010-04-07 18:11:43 +10:00
Kconfig.debug Merge branch 'next' of git://git.secretlab.ca/git/linux-2.6 2009-12-16 13:26:53 -08:00
Makefile powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE 2009-09-24 15:31:40 +10:00
relocs_check.pl powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE 2009-09-24 15:31:40 +10:00