Skip to content

Commit

Permalink
memory-hotplug: remove page table of x86_64 architecture
Browse files Browse the repository at this point in the history
Search a page table about the removed memory, and clear page table for
x86_64 architecture.

[[email protected]: make kernel_physical_mapping_remove() static]
Signed-off-by: Wen Congyang <[email protected]>
Signed-off-by: Jianguo Wu <[email protected]>
Signed-off-by: Jiang Liu <[email protected]>
Signed-off-by: Tang Chen <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Cc: Kamezawa Hiroyuki <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Cc: Wu Jianguo <[email protected]>
Cc: Yasuaki Ishimatsu <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
tang-chen authored and torvalds committed Feb 24, 2013
1 parent ae9aae9 commit bbcab87
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,15 @@ remove_pagetable(unsigned long start, unsigned long end, bool direct)
flush_tlb_all();
}

static void __meminit
kernel_physical_mapping_remove(unsigned long start, unsigned long end)
{
start = (unsigned long)__va(start);
end = (unsigned long)__va(end);

remove_pagetable(start, end, true);
}

#ifdef CONFIG_MEMORY_HOTREMOVE
int __ref arch_remove_memory(u64 start, u64 size)
{
Expand All @@ -1020,6 +1029,7 @@ int __ref arch_remove_memory(u64 start, u64 size)
int ret;

zone = page_zone(pfn_to_page(start_pfn));
kernel_physical_mapping_remove(start, start + size);
ret = __remove_pages(zone, start_pfn, nr_pages);
WARN_ON_ONCE(ret);

Expand Down

0 comments on commit bbcab87

Please sign in to comment.