aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/task_mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/task_mmu.c')
-rw-r--r--fs/proc/task_mmu.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index d7e2af334076..26f9cc00102c 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -1,5 +1,6 @@
1#include <linux/mm.h> 1#include <linux/mm.h>
2#include <linux/hugetlb.h> 2#include <linux/hugetlb.h>
3#include <linux/huge_mm.h>
3#include <linux/mount.h> 4#include <linux/mount.h>
4#include <linux/seq_file.h> 5#include <linux/seq_file.h>
5#include <linux/highmem.h> 6#include <linux/highmem.h>
@@ -7,6 +8,7 @@
7#include <linux/slab.h> 8#include <linux/slab.h>
8#include <linux/pagemap.h> 9#include <linux/pagemap.h>
9#include <linux/mempolicy.h> 10#include <linux/mempolicy.h>
11#include <linux/rmap.h>
10#include <linux/swap.h> 12#include <linux/swap.h>
11#include <linux/swapops.h> 13#include <linux/swapops.h>
12 14
@@ -385,8 +387,25 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
385 pte_t *pte; 387 pte_t *pte;
386 spinlock_t *ptl; 388 spinlock_t *ptl;
387 389
388 split_huge_page_pmd(walk->mm, pmd); 390 spin_lock(&walk->mm->page_table_lock);
389 391 if (pmd_trans_huge(*pmd)) {
392 if (pmd_trans_splitting(*pmd)) {
393 spin_unlock(&walk->mm->page_table_lock);
394 wait_split_huge_page(vma->anon_vma, pmd);
395 } else {
396 smaps_pte_entry(*(pte_t *)pmd, addr,
397 HPAGE_PMD_SIZE, walk);
398 spin_unlock(&walk->mm->page_table_lock);
399 return 0;
400 }
401 } else {
402 spin_unlock(&walk->mm->page_table_lock);
403 }
404 /*
405 * The mmap_sem held all the way back in m_start() is what
406 * keeps khugepaged out of here and from collapsing things
407 * in here.
408 */
390 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); 409 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
391 for (; addr != end; pte++, addr += PAGE_SIZE) 410 for (; addr != end; pte++, addr += PAGE_SIZE)
392 smaps_pte_entry(*pte, addr, PAGE_SIZE, walk); 411 smaps_pte_entry(*pte, addr, PAGE_SIZE, walk);