android_kernel_xiaomi_sm8350/arch/x86/mm
Jeremy Fitzhardinge d8d5900ef8 x86: preallocate and prepopulate separately
Jan Beulich points out that vmalloc_sync_all() assumes that the
kernel's pmd is always expected to be present in the pgd.  The current
pgd construction code will add the pgd to the pgd_list before its pmds
have been pre-populated, thereby making it visible to
vmalloc_sync_all().

However, because pgd_prepopulate_pmd also does the allocation, it may
block and cannot be done under spinlock.

The solution is to preallocate the pmds out of the spinlock, then
populate them while holding the pgd_list lock.

This patch also pulls the pmd preallocation and mop-up functions out
to be common, assuming that the compiler will generate no code for
them when PREALLOCTED_PMDS is 0.  Also, there's no need for pgd_ctor
to clear the pgd again, since it's allocated as a zeroed page.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Jan Beulich <jbeulich@novell.com>

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-08 13:11:02 +02:00
..
discontig_32.c x86: introduce init_memory_mapping for 32bit #3 2008-07-08 13:10:33 +02:00
dump_pagetables.c x86_64: use PAGE_OFFSET in dump_pagetables 2008-07-08 08:12:06 +02:00
extable.c x86: unify extable_{32|64}.c 2008-01-30 13:31:41 +01:00
fault.c x86: simplify vmalloc_sync_all 2008-07-08 13:10:59 +02:00
highmem_32.c x86: unexport kmap_atomic_to_page 2008-04-30 23:15:34 +02:00
hugetlbpage.c x86: stricter check in follow_huge_addr() 2008-03-27 16:08:45 +01:00
init_32.c x86: introduce init_memory_mapping for 32bit #3 2008-07-08 13:10:33 +02:00
init_64.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00
ioremap.c x86, 64-bit: unify early_ioremap 2008-07-08 13:10:28 +02:00
k8topology_64.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00
Makefile x86: add common mm/pgtable.c 2008-04-24 23:57:30 +02:00
mmap.c
numa_64.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00
pageattr-test.c x86: remove over noisy debug printk 2008-02-11 11:24:24 -08:00
pageattr.c Merge branches 'x86/numa-fixes', 'x86/apic', 'x86/apm', 'x86/bitops', 'x86/build', 'x86/cleanups', 'x86/cpa', 'x86/cpu', 'x86/defconfig', 'x86/gart', 'x86/i8259', 'x86/intel', 'x86/irqstats', 'x86/kconfig', 'x86/ldt', 'x86/mce', 'x86/memtest', 'x86/pat', 'x86/ptemask', 'x86/resumetrace', 'x86/threadinfo', 'x86/timers', 'x86/vdso' and 'x86/xen' into x86/devel 2008-07-08 09:16:56 +02:00
pat.c x86: pat.c final cleanup of loop body in reserve_memtype 2008-06-24 13:05:59 +02:00
pgtable_32.c x86: move reservetop and vmalloc parsing to pgtable_32.c 2008-07-08 12:50:19 +02:00
pgtable.c x86: preallocate and prepopulate separately 2008-07-08 13:11:02 +02:00
srat_64.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00