aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/task_mmu.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index eeab30fcffcc..73425398b38c 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -436,7 +436,6 @@ const struct file_operations proc_tid_maps_operations = {
436 436
437#ifdef CONFIG_PROC_PAGE_MONITOR 437#ifdef CONFIG_PROC_PAGE_MONITOR
438struct mem_size_stats { 438struct mem_size_stats {
439 struct vm_area_struct *vma;
440 unsigned long resident; 439 unsigned long resident;
441 unsigned long shared_clean; 440 unsigned long shared_clean;
442 unsigned long shared_dirty; 441 unsigned long shared_dirty;
@@ -485,7 +484,7 @@ static void smaps_pte_entry(pte_t *pte, unsigned long addr,
485 struct mm_walk *walk) 484 struct mm_walk *walk)
486{ 485{
487 struct mem_size_stats *mss = walk->private; 486 struct mem_size_stats *mss = walk->private;
488 struct vm_area_struct *vma = mss->vma; 487 struct vm_area_struct *vma = walk->vma;
489 struct page *page = NULL; 488 struct page *page = NULL;
490 489
491 if (pte_present(*pte)) { 490 if (pte_present(*pte)) {
@@ -509,7 +508,7 @@ static void smaps_pmd_entry(pmd_t *pmd, unsigned long addr,
509 struct mm_walk *walk) 508 struct mm_walk *walk)
510{ 509{
511 struct mem_size_stats *mss = walk->private; 510 struct mem_size_stats *mss = walk->private;
512 struct vm_area_struct *vma = mss->vma; 511 struct vm_area_struct *vma = walk->vma;
513 struct page *page; 512 struct page *page;
514 513
515 /* FOLL_DUMP will return -EFAULT on huge zero page */ 514 /* FOLL_DUMP will return -EFAULT on huge zero page */
@@ -530,8 +529,7 @@ static void smaps_pmd_entry(pmd_t *pmd, unsigned long addr,
530static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, 529static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
531 struct mm_walk *walk) 530 struct mm_walk *walk)
532{ 531{
533 struct mem_size_stats *mss = walk->private; 532 struct vm_area_struct *vma = walk->vma;
534 struct vm_area_struct *vma = mss->vma;
535 pte_t *pte; 533 pte_t *pte;
536 spinlock_t *ptl; 534 spinlock_t *ptl;
537 535
@@ -623,10 +621,8 @@ static int show_smap(struct seq_file *m, void *v, int is_pid)
623 }; 621 };
624 622
625 memset(&mss, 0, sizeof mss); 623 memset(&mss, 0, sizeof mss);
626 mss.vma = vma;
627 /* mmap_sem is held in m_start */ 624 /* mmap_sem is held in m_start */
628 if (vma->vm_mm && !is_vm_hugetlb_page(vma)) 625 walk_page_vma(vma, &smaps_walk);
629 walk_page_range(vma->vm_start, vma->vm_end, &smaps_walk);
630 626
631 show_map_vma(m, vma, is_pid); 627 show_map_vma(m, vma, is_pid);
632 628