aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/init_64.c
diff options
context:
space:
mode:
authorHaicheng Li <haicheng.li@linux.intel.com>2010-05-19 05:42:14 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2010-08-26 17:02:29 -0400
commit6afb5157b9eba4092e2f0f54d24a3806409bdde5 (patch)
tree5d213ef0366441af288b3a293557df09cb45cdca /arch/x86/mm/init_64.c
parent61c77326d1df079f202fa79403c3ccd8c5966a81 (diff)
x86, mm: Separate x86_64 vmalloc_sync_all() into separate functions
No behavior change. Move some of vmalloc_sync_all() code into a new function sync_global_pgds() that will be useful for memory hotplug. Signed-off-by: Haicheng Li <haicheng.li@linux.intel.com> LKML-Reference: <4C6E4ECD.1090607@linux.intel.com> Reviewed-by: Wu Fengguang <fengguang.wu@intel.com> Reviewed-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/mm/init_64.c')
-rw-r--r--arch/x86/mm/init_64.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 9a6674689a20..61a1b4fdecbf 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -98,6 +98,36 @@ static int __init nonx32_setup(char *str)
98__setup("noexec32=", nonx32_setup); 98__setup("noexec32=", nonx32_setup);
99 99
100/* 100/*
101 * When memory was added/removed make sure all the processes MM have
102 * suitable PGD entries in the local PGD level page.
103 */
104void sync_global_pgds(unsigned long start, unsigned long end)
105{
106 unsigned long address;
107
108 for (address = start; address <= end; address += PGDIR_SIZE) {
109 const pgd_t *pgd_ref = pgd_offset_k(address);
110 unsigned long flags;
111 struct page *page;
112
113 if (pgd_none(*pgd_ref))
114 continue;
115
116 spin_lock_irqsave(&pgd_lock, flags);
117 list_for_each_entry(page, &pgd_list, lru) {
118 pgd_t *pgd;
119 pgd = (pgd_t *)page_address(page) + pgd_index(address);
120 if (pgd_none(*pgd))
121 set_pgd(pgd, *pgd_ref);
122 else
123 BUG_ON(pgd_page_vaddr(*pgd)
124 != pgd_page_vaddr(*pgd_ref));
125 }
126 spin_unlock_irqrestore(&pgd_lock, flags);
127 }
128}
129
130/*
101 * NOTE: This function is marked __ref because it calls __init function 131 * NOTE: This function is marked __ref because it calls __init function
102 * (alloc_bootmem_pages). It's safe to do it ONLY when after_bootmem == 0. 132 * (alloc_bootmem_pages). It's safe to do it ONLY when after_bootmem == 0.
103 */ 133 */