• Home
  • Raw
  • Download

Lines Matching refs:vma

126 static void seq_print_vma_name(struct seq_file *m, struct vm_area_struct *vma)  in seq_print_vma_name()  argument
128 const char __user *name = vma_get_anon_name(vma); in seq_print_vma_name()
129 struct mm_struct *mm = vma->vm_mm; in seq_print_vma_name()
186 m_next_vma(struct proc_maps_private *priv, struct vm_area_struct *vma) in m_next_vma() argument
188 if (vma == priv->tail_vma) in m_next_vma()
190 return vma->vm_next ?: priv->tail_vma; in m_next_vma()
193 static void m_cache_vma(struct seq_file *m, struct vm_area_struct *vma) in m_cache_vma() argument
196 m->version = m_next_vma(m->private, vma) ? vma->vm_end : -1UL; in m_cache_vma()
204 struct vm_area_struct *vma; in m_start() local
228 vma = find_vma(mm, last_addr - 1); in m_start()
229 if (vma && vma->vm_start <= last_addr) in m_start()
230 vma = m_next_vma(priv, vma); in m_start()
231 if (vma) in m_start()
232 return vma; in m_start()
237 for (vma = mm->mmap; pos; pos--) { in m_start()
238 m->version = vma->vm_start; in m_start()
239 vma = vma->vm_next; in m_start()
241 return vma; in m_start()
318 static int is_stack(struct vm_area_struct *vma) in is_stack() argument
325 return vma->vm_start <= vma->vm_mm->start_stack && in is_stack()
326 vma->vm_end >= vma->vm_mm->start_stack; in is_stack()
350 show_map_vma(struct seq_file *m, struct vm_area_struct *vma) in show_map_vma() argument
352 struct mm_struct *mm = vma->vm_mm; in show_map_vma()
353 struct file *file = vma->vm_file; in show_map_vma()
354 vm_flags_t flags = vma->vm_flags; in show_map_vma()
362 struct inode *inode = file_inode(vma->vm_file); in show_map_vma()
365 pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; in show_map_vma()
368 start = vma->vm_start; in show_map_vma()
369 end = vma->vm_end; in show_map_vma()
382 if (vma->vm_ops && vma->vm_ops->name) { in show_map_vma()
383 name = vma->vm_ops->name(vma); in show_map_vma()
388 name = arch_vma_name(vma); in show_map_vma()
395 if (vma->vm_start <= mm->brk && in show_map_vma()
396 vma->vm_end >= mm->start_brk) { in show_map_vma()
401 if (is_stack(vma)) { in show_map_vma()
406 if (vma_get_anon_name(vma)) { in show_map_vma()
408 seq_print_vma_name(m, vma); in show_map_vma()
570 walk->vma->vm_file->f_mapping, addr, end); in smaps_pte_hole()
582 struct vm_area_struct *vma = walk->vma; in smaps_pte_entry() local
583 bool locked = !!(vma->vm_flags & VM_LOCKED); in smaps_pte_entry()
587 page = vm_normal_page(vma, addr, *pte); in smaps_pte_entry()
610 page = find_get_entry(vma->vm_file->f_mapping, in smaps_pte_entry()
611 linear_page_index(vma, addr)); in smaps_pte_entry()
634 struct vm_area_struct *vma = walk->vma; in smaps_pmd_entry() local
635 bool locked = !!(vma->vm_flags & VM_LOCKED); in smaps_pmd_entry()
639 page = follow_trans_huge_pmd(vma, addr, pmd, FOLL_DUMP); in smaps_pmd_entry()
662 struct vm_area_struct *vma = walk->vma; in smaps_pte_range() local
666 ptl = pmd_trans_huge_lock(pmd, vma); in smaps_pte_range()
681 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); in smaps_pte_range()
690 static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) in show_smap_vma_flags() argument
754 if (vma->vm_flags & (1UL << i)) { in show_smap_vma_flags()
769 struct vm_area_struct *vma = walk->vma; in smaps_hugetlb_range() local
773 page = vm_normal_page(vma, addr, *pte); in smaps_hugetlb_range()
786 mss->shared_hugetlb += huge_page_size(hstate_vma(vma)); in smaps_hugetlb_range()
788 mss->private_hugetlb += huge_page_size(hstate_vma(vma)); in smaps_hugetlb_range()
807 static void smap_gather_stats(struct vm_area_struct *vma, in smap_gather_stats() argument
813 if (vma->vm_file && shmem_mapping(vma->vm_file->f_mapping)) { in smap_gather_stats()
824 unsigned long shmem_swapped = shmem_swap_usage(vma); in smap_gather_stats()
826 if (!shmem_swapped || (vma->vm_flags & VM_SHARED) || in smap_gather_stats()
827 !(vma->vm_flags & VM_WRITE)) { in smap_gather_stats()
831 walk_page_vma(vma, &smaps_shmem_walk_ops, mss); in smap_gather_stats()
837 walk_page_vma(vma, &smaps_walk_ops, mss); in smap_gather_stats()
884 struct vm_area_struct *vma = v; in show_smap() local
889 smap_gather_stats(vma, &mss); in show_smap()
891 show_map_vma(m, vma); in show_smap()
892 if (vma_get_anon_name(vma)) { in show_smap()
894 seq_print_vma_name(m, vma); in show_smap()
898 SEQ_PUT_DEC("Size: ", vma->vm_end - vma->vm_start); in show_smap()
899 SEQ_PUT_DEC(" kB\nKernelPageSize: ", vma_kernel_pagesize(vma)); in show_smap()
900 SEQ_PUT_DEC(" kB\nMMUPageSize: ", vma_mmu_pagesize(vma)); in show_smap()
906 transparent_hugepage_enabled(vma)); in show_smap()
909 seq_printf(m, "ProtectionKey: %8u\n", vma_pkey(vma)); in show_smap()
910 show_smap_vma_flags(m, vma); in show_smap()
912 m_cache_vma(m, vma); in show_smap()
922 struct vm_area_struct *vma; in show_smaps_rollup() local
944 for (vma = priv->mm->mmap; vma; vma = vma->vm_next) { in show_smaps_rollup()
945 smap_gather_stats(vma, &mss); in show_smaps_rollup()
946 last_vma_end = vma->vm_end; in show_smaps_rollup()
1050 static inline void clear_soft_dirty(struct vm_area_struct *vma, in clear_soft_dirty() argument
1064 old_pte = ptep_modify_prot_start(vma, addr, pte); in clear_soft_dirty()
1067 ptep_modify_prot_commit(vma, addr, pte, old_pte, ptent); in clear_soft_dirty()
1070 set_pte_at(vma->vm_mm, addr, pte, ptent); in clear_soft_dirty()
1074 static inline void clear_soft_dirty(struct vm_area_struct *vma, in clear_soft_dirty() argument
1081 static inline void clear_soft_dirty_pmd(struct vm_area_struct *vma, in clear_soft_dirty_pmd() argument
1088 old = pmdp_invalidate(vma, addr, pmdp); in clear_soft_dirty_pmd()
1097 set_pmd_at(vma->vm_mm, addr, pmdp, pmd); in clear_soft_dirty_pmd()
1100 set_pmd_at(vma->vm_mm, addr, pmdp, pmd); in clear_soft_dirty_pmd()
1104 static inline void clear_soft_dirty_pmd(struct vm_area_struct *vma, in clear_soft_dirty_pmd() argument
1114 struct vm_area_struct *vma = walk->vma; in clear_refs_pte_range() local
1119 ptl = pmd_trans_huge_lock(pmd, vma); in clear_refs_pte_range()
1122 clear_soft_dirty_pmd(vma, addr, pmd); in clear_refs_pte_range()
1132 pmdp_test_and_clear_young(vma, addr, pmd); in clear_refs_pte_range()
1143 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); in clear_refs_pte_range()
1148 clear_soft_dirty(vma, addr, pte); in clear_refs_pte_range()
1155 page = vm_normal_page(vma, addr, ptent); in clear_refs_pte_range()
1160 ptep_test_and_clear_young(vma, addr, pte); in clear_refs_pte_range()
1173 struct vm_area_struct *vma = walk->vma; in clear_refs_test_walk() local
1175 if (vma->vm_flags & VM_PFNMAP) in clear_refs_test_walk()
1184 if (cp->type == CLEAR_REFS_ANON && vma->vm_file) in clear_refs_test_walk()
1186 if (cp->type == CLEAR_REFS_MAPPED && !vma->vm_file) in clear_refs_test_walk()
1202 struct vm_area_struct *vma; in clear_refs_write() local
1251 for (vma = mm->mmap; vma; vma = vma->vm_next) { in clear_refs_write()
1252 if (!(vma->vm_flags & VM_SOFTDIRTY)) in clear_refs_write()
1277 for (vma = mm->mmap; vma; vma = vma->vm_next) { in clear_refs_write()
1278 vma->vm_flags &= ~VM_SOFTDIRTY; in clear_refs_write()
1279 vma_set_page_prot(vma); in clear_refs_write()
1354 struct vm_area_struct *vma = find_vma(walk->mm, addr); in pagemap_pte_hole() local
1359 if (vma) in pagemap_pte_hole()
1360 hole_end = min(end, vma->vm_start); in pagemap_pte_hole()
1370 if (!vma) in pagemap_pte_hole()
1374 if (vma->vm_flags & VM_SOFTDIRTY) in pagemap_pte_hole()
1376 for (; addr < min(end, vma->vm_end); addr += PAGE_SIZE) { in pagemap_pte_hole()
1387 struct vm_area_struct *vma, unsigned long addr, pte_t pte) in pte_to_pagemap_entry() argument
1396 page = vm_normal_page(vma, addr, pte); in pte_to_pagemap_entry()
1419 if (vma->vm_flags & VM_SOFTDIRTY) in pte_to_pagemap_entry()
1428 struct vm_area_struct *vma = walk->vma; in pagemap_pmd_range() local
1435 ptl = pmd_trans_huge_lock(pmdp, vma); in pagemap_pmd_range()
1441 if (vma->vm_flags & VM_SOFTDIRTY) in pagemap_pmd_range()
1505 pme = pte_to_pagemap_entry(pm, vma, addr, *pte); in pagemap_pmd_range()
1524 struct vm_area_struct *vma = walk->vma; in pagemap_hugetlb_range() local
1529 if (vma->vm_flags & VM_SOFTDIRTY) in pagemap_hugetlb_range()
1756 static struct page *can_gather_numa_stats(pte_t pte, struct vm_area_struct *vma, in can_gather_numa_stats() argument
1765 page = vm_normal_page(vma, addr, pte); in can_gather_numa_stats()
1781 struct vm_area_struct *vma, in can_gather_numa_stats_pmd() argument
1790 page = vm_normal_page_pmd(vma, addr, pmd); in can_gather_numa_stats_pmd()
1809 struct vm_area_struct *vma = walk->vma; in gather_pte_stats() local
1815 ptl = pmd_trans_huge_lock(pmd, vma); in gather_pte_stats()
1819 page = can_gather_numa_stats_pmd(*pmd, vma, addr); in gather_pte_stats()
1832 struct page *page = can_gather_numa_stats(*pte, vma, addr); in gather_pte_stats()
1882 struct vm_area_struct *vma = v; in show_numa_map() local
1884 struct file *file = vma->vm_file; in show_numa_map()
1885 struct mm_struct *mm = vma->vm_mm; in show_numa_map()
1896 pol = __get_vma_policy(vma, vma->vm_start); in show_numa_map()
1904 seq_printf(m, "%08lx %s", vma->vm_start, buffer); in show_numa_map()
1909 } else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) { in show_numa_map()
1911 } else if (is_stack(vma)) { in show_numa_map()
1915 if (is_vm_hugetlb_page(vma)) in show_numa_map()
1919 walk_page_vma(vma, &show_numa_ops, md); in show_numa_map()
1939 if (md->active < md->pages && !is_vm_hugetlb_page(vma)) in show_numa_map()
1949 seq_printf(m, " kernelpagesize_kB=%lu", vma_kernel_pagesize(vma) >> 10); in show_numa_map()
1952 m_cache_vma(m, vma); in show_numa_map()