• Home
  • Raw
  • Download

Lines Matching refs:vma

369 			struct vm_area_struct *vma, struct zone *zone,  in __munlock_pagevec_fill()  argument
380 pte = get_locked_pte(vma->vm_mm, start, &ptl); in __munlock_pagevec_fill()
393 page = vm_normal_page(vma, start, *pte); in __munlock_pagevec_fill()
439 void munlock_vma_pages_range(struct vm_area_struct *vma, in munlock_vma_pages_range() argument
442 vma->vm_flags &= VM_LOCKED_CLEAR_MASK; in munlock_vma_pages_range()
459 page = follow_page(vma, start, FOLL_GET | FOLL_DUMP); in munlock_vma_pages_range()
491 start = __munlock_pagevec_fill(&pvec, vma, in munlock_vma_pages_range()
513 static int mlock_fixup(struct vm_area_struct *vma, struct vm_area_struct **prev, in mlock_fixup() argument
516 struct mm_struct *mm = vma->vm_mm; in mlock_fixup()
521 vm_flags_t old_flags = vma->vm_flags; in mlock_fixup()
523 if (newflags == vma->vm_flags || (vma->vm_flags & VM_SPECIAL) || in mlock_fixup()
524 is_vm_hugetlb_page(vma) || vma == get_gate_vma(current->mm)) in mlock_fixup()
528 pgoff = vma->vm_pgoff + ((start - vma->vm_start) >> PAGE_SHIFT); in mlock_fixup()
529 *prev = vma_merge(mm, *prev, start, end, newflags, vma->anon_vma, in mlock_fixup()
530 vma->vm_file, pgoff, vma_policy(vma), in mlock_fixup()
531 vma->vm_userfaultfd_ctx, vma_get_anon_name(vma)); in mlock_fixup()
533 vma = *prev; in mlock_fixup()
537 if (start != vma->vm_start) { in mlock_fixup()
538 ret = split_vma(mm, vma, start, 1); in mlock_fixup()
543 if (end != vma->vm_end) { in mlock_fixup()
544 ret = split_vma(mm, vma, end, 0); in mlock_fixup()
567 vma->vm_flags = newflags; in mlock_fixup()
569 munlock_vma_pages_range(vma, start, end); in mlock_fixup()
572 *prev = vma; in mlock_fixup()
580 struct vm_area_struct * vma, * prev; in apply_vma_lock_flags() local
590 vma = find_vma(current->mm, start); in apply_vma_lock_flags()
591 if (!vma || vma->vm_start > start) in apply_vma_lock_flags()
594 prev = vma->vm_prev; in apply_vma_lock_flags()
595 if (start > vma->vm_start) in apply_vma_lock_flags()
596 prev = vma; in apply_vma_lock_flags()
599 vm_flags_t newflags = vma->vm_flags & VM_LOCKED_CLEAR_MASK; in apply_vma_lock_flags()
604 tmp = vma->vm_end; in apply_vma_lock_flags()
607 error = mlock_fixup(vma, &prev, nstart, tmp, newflags); in apply_vma_lock_flags()
616 vma = prev->vm_next; in apply_vma_lock_flags()
617 if (!vma || vma->vm_start != nstart) { in apply_vma_lock_flags()
635 struct vm_area_struct *vma; in count_mm_mlocked_page_nr() local
641 vma = find_vma(mm, start); in count_mm_mlocked_page_nr()
642 if (vma == NULL) in count_mm_mlocked_page_nr()
643 vma = mm->mmap; in count_mm_mlocked_page_nr()
645 for (; vma ; vma = vma->vm_next) { in count_mm_mlocked_page_nr()
646 if (start >= vma->vm_end) in count_mm_mlocked_page_nr()
648 if (start + len <= vma->vm_start) in count_mm_mlocked_page_nr()
650 if (vma->vm_flags & VM_LOCKED) { in count_mm_mlocked_page_nr()
651 if (start > vma->vm_start) in count_mm_mlocked_page_nr()
652 count -= (start - vma->vm_start); in count_mm_mlocked_page_nr()
653 if (start + len < vma->vm_end) { in count_mm_mlocked_page_nr()
654 count += start + len - vma->vm_start; in count_mm_mlocked_page_nr()
657 count += vma->vm_end - vma->vm_start; in count_mm_mlocked_page_nr()
756 struct vm_area_struct * vma, * prev = NULL; in apply_mlockall_flags() local
776 for (vma = current->mm->mmap; vma ; vma = prev->vm_next) { in apply_mlockall_flags()
779 newflags = vma->vm_flags & VM_LOCKED_CLEAR_MASK; in apply_mlockall_flags()
783 mlock_fixup(vma, &prev, vma->vm_start, vma->vm_end, newflags); in apply_mlockall_flags()