ARM: memory hotplug: stop cpus while memory hotplug
Avoid page table corruptions during memory hotplug by stopping all other cpus. Change-Id: I527a616c5603b882a43626c746ef0b4dda977202 Signed-off-by: Venkata Rao Kakani <vkakani@codeaurora.org>
This commit is contained in:
parent
9912a8c48b
commit
42cadd5165
1 changed files with 12 additions and 3 deletions
|
@ -656,10 +656,16 @@ static phys_addr_t pgd_pgtable_alloc(void)
|
|||
*/
|
||||
void hotplug_paging(phys_addr_t start, phys_addr_t size)
|
||||
{
|
||||
|
||||
struct page *pg;
|
||||
phys_addr_t pgd_phys = pgd_pgtable_alloc();
|
||||
pgd_t *pgd = pgd_set_fixmap(pgd_phys);
|
||||
phys_addr_t pgd_phys;
|
||||
pgd_t *pgd;
|
||||
int cpu;
|
||||
|
||||
for_each_possible_cpu(cpu)
|
||||
if (current->cpu != cpu)
|
||||
sched_isolate_cpu(cpu);
|
||||
pgd_phys = pgd_pgtable_alloc();
|
||||
pgd = pgd_set_fixmap(pgd_phys);
|
||||
|
||||
memcpy(pgd, swapper_pg_dir, PAGE_SIZE);
|
||||
|
||||
|
@ -675,6 +681,9 @@ void hotplug_paging(phys_addr_t start, phys_addr_t size)
|
|||
pg = phys_to_page(pgd_phys);
|
||||
pgtable_page_dtor(pg);
|
||||
__free_pages(pg, 0);
|
||||
for_each_possible_cpu(cpu)
|
||||
if (current->cpu != cpu)
|
||||
sched_unisolate_cpu_unlocked(cpu);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MEMORY_HOTREMOVE
|
||||
|
|
Loading…
Add table
Reference in a new issue