search for: mmu_notifier_range_init_own

Displaying 5 results from an estimated 5 matches for "mmu_notifier_range_init_own".

2023 Mar 28
1
[PATCH] mm: Take a page reference when removing device exclusive entries
...d suggest two things: > > 1) Normally, what I've seen done is to post against either the current > top of tree linux.git, or else against one of the mm-stable branches. > And then after it's accepted, create a version for -stable. Yup. I had to jiggle the patch a bit because mmu_notifier_range_init_owner()'s arguments have changed. Once this hits mainline, the -stable maintainers will probably ask for a version which suits the relevant kernel version(s).
2023 Mar 28
3
[PATCH] mm: Take a page reference when removing device exclusive entries
...device-exclusive entry and unmap the page. If the page is + * free the entry must have been removed already. + */ + if (!get_page_unless_zero(vmf->page)) + return 0; + + if (!folio_lock_or_retry(folio, vma->vm_mm, vmf->flags)) { + put_page(vmf->page); return VM_FAULT_RETRY; + } mmu_notifier_range_init_owner(&range, MMU_NOTIFY_EXCLUSIVE, 0, vma, vma->vm_mm, vmf->address & PAGE_MASK, (vmf->address & PAGE_MASK) + PAGE_SIZE, NULL); @@ -3637,6 +3648,7 @@ static vm_fault_t remove_device_exclusive_entry(struct vm_fault *vmf) pte_unmap_unlock(vmf->pte, vmf->ptl); f...
2023 Mar 28
1
[PATCH] mm: Take a page reference when removing device exclusive entries
...page is > + * free the entry must have been removed already. > + */ > + if (!get_page_unless_zero(vmf->page)) > + return 0; > + > + if (!folio_lock_or_retry(folio, vma->vm_mm, vmf->flags)) { > + put_page(vmf->page); > return VM_FAULT_RETRY; > + } > mmu_notifier_range_init_owner(&range, MMU_NOTIFY_EXCLUSIVE, 0, vma, > vma->vm_mm, vmf->address & PAGE_MASK, > (vmf->address & PAGE_MASK) + PAGE_SIZE, NULL); > @@ -3637,6 +3648,7 @@ static vm_fault_t remove_device_exclusive_entry(struct vm_fault *vmf) > > pte_unmap_unlock(vmf-&...
2023 Mar 30
4
[PATCH v2] mm: Take a page reference when removing device exclusive entries
...een removed already. If it happens to have already + * been re-allocated after being freed all we do is lock and + * unlock it. + */ + if (!folio_try_get(folio)) + return 0; + + if (!folio_lock_or_retry(folio, vma->vm_mm, vmf->flags)) { + folio_put(folio); return VM_FAULT_RETRY; + } mmu_notifier_range_init_owner(&range, MMU_NOTIFY_EXCLUSIVE, 0, vma->vm_mm, vmf->address & PAGE_MASK, (vmf->address & PAGE_MASK) + PAGE_SIZE, NULL); @@ -3577,6 +3590,7 @@ static vm_fault_t remove_device_exclusive_entry(struct vm_fault *vmf) pte_unmap_unlock(vmf->pte, vmf->ptl); folio_...
2023 Mar 29
1
[PATCH] mm: Take a page reference when removing device exclusive entries
...ctually taken on the folio. So this should be: if (!folio_try_get(folio)) return 0; (you can fix up the comment yourself) > + if (!folio_lock_or_retry(folio, vma->vm_mm, vmf->flags)) { > + put_page(vmf->page); folio_put(folio); > return VM_FAULT_RETRY; > + } > mmu_notifier_range_init_owner(&range, MMU_NOTIFY_EXCLUSIVE, 0, vma, > vma->vm_mm, vmf->address & PAGE_MASK, > (vmf->address & PAGE_MASK) + PAGE_SIZE, NULL); > @@ -3637,6 +3648,7 @@ static vm_fault_t remove_device_exclusive_entry(struct vm_fault *vmf) > > pte_unmap_unlock(vmf-&...