aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorWen Congyang <[email protected]>2013-02-22 16:33:04 -0800
committerLinus Torvalds <[email protected]>2013-02-23 17:50:12 -0800
commitae9aae9eda2db71bf4b592f15618b0160eb07731 (patch)
tree9d91b4cba95a464cc19afc33a54d807ec2f372fc /tools/perf/scripts/python
parentcd099682e4c786c3a866e462b37fcac6e3a44a68 (diff)
memory-hotplug: common APIs to support page tables hot-remove
When memory is removed, the corresponding pagetables should alse be removed. This patch introduces some common APIs to support vmemmap pagetable and x86_64 architecture direct mapping pagetable removing. All pages of virtual mapping in removed memory cannot be freed if some pages used as PGD/PUD include not only removed memory but also other memory. So this patch uses the following way to check whether a page can be freed or not. 1) When removing memory, the page structs of the removed memory are filled with 0FD. 2) All page structs are filled with 0xFD on PT/PMD, PT/PMD can be cleared. In this case, the page used as PT/PMD can be freed. For direct mapping pages, update direct_pages_count[level] when we freed their pagetables. And do not free the pages again because they were freed when offlining. For vmemmap pages, free the pages and their pagetables. For larger pages, do not split them into smaller ones because there is no way to know if the larger page has been split. As a result, there is no way to decide when to split. We deal the larger pages in the following way: 1) For direct mapped pages, all the pages were freed when they were offlined. And since menmory offline is done section by section, all the memory ranges being removed are aligned to PAGE_SIZE. So only need to deal with unaligned pages when freeing vmemmap pages. 2) For vmemmap pages being used to store page_struct, if part of the larger page is still in use, just fill the unused part with 0xFD. And when the whole page is fulfilled with 0xFD, then free the larger page. [[email protected]: fix typo in comment] [[email protected]: do not calculate direct mapping pages when freeing vmemmap pagetables] [[email protected]: do not free direct mapping pages twice] [[email protected]: do not free page split from hugepage one by one] [[email protected]: do not split pages when freeing pagetable pages] [[email protected]: use pmd_page_vaddr()] [[email protected]: fix used-uninitialised bug] Signed-off-by: Yasuaki Ishimatsu <[email protected]> Signed-off-by: Jianguo Wu <[email protected]> Signed-off-by: Wen Congyang <[email protected]> Signed-off-by: Tang Chen <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Jiang Liu <[email protected]> Cc: Kamezawa Hiroyuki <[email protected]> Cc: Lai Jiangshan <[email protected]> Cc: Wu Jianguo <[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]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions