Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

teach /proc/$pid/numa_maps about transparent hugepages

This is modeled after the smaps code.

It detects transparent hugepages and then does a single gather_stats()
for the page as a whole. This has two benifits:
1. It is more efficient since it does many pages in a single shot.
2. It does not have to break down the huge page.

Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com>
Acked-by: Hugh Dickins <hughd@google.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Dave Hansen and committed by
Linus Torvalds
32ef4384 3200a8aa

+20
+20
fs/proc/task_mmu.c
··· 936 936 pte_t *pte; 937 937 938 938 md = walk->private; 939 + spin_lock(&walk->mm->page_table_lock); 940 + if (pmd_trans_huge(*pmd)) { 941 + if (pmd_trans_splitting(*pmd)) { 942 + spin_unlock(&walk->mm->page_table_lock); 943 + wait_split_huge_page(md->vma->anon_vma, pmd); 944 + } else { 945 + pte_t huge_pte = *(pte_t *)pmd; 946 + struct page *page; 947 + 948 + page = can_gather_numa_stats(huge_pte, md->vma, addr); 949 + if (page) 950 + gather_stats(page, md, pte_dirty(huge_pte), 951 + HPAGE_PMD_SIZE/PAGE_SIZE); 952 + spin_unlock(&walk->mm->page_table_lock); 953 + return 0; 954 + } 955 + } else { 956 + spin_unlock(&walk->mm->page_table_lock); 957 + } 958 + 939 959 orig_pte = pte = pte_offset_map_lock(walk->mm, pmd, addr, &ptl); 940 960 do { 941 961 struct page *page = can_gather_numa_stats(*pte, md->vma, addr);