Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > > > + down_write(&mm->mmap_sem);
- > > > + result = hugepage_vma_revalidate(mm, vma, address);
- > > > + if (result)
- > > > + goto out;
- > > >
- > > > anon_vma_lock_write(vma->anon_vma);
- > >
- > > Didn't Kirill have a concern that the vma might go away after up_read
- > > and before down_write?
- >
- > hugepage_vma_revalidate does the revalidation. Scratch my comment. Sorry
- > about the noise. I just saw the vma still being used and that raised a
- > flag. I should have looked into hugepage_vma_revalidate to see that vma
- > is not actually used and it can be dropped.
- One thing to notice is that passing 'vma' to hugepage_vma_revlidate() is
- useless. It doesn't make use of it anyway.
- Fixup:
- diff --git a/mm/huge_memory.c b/mm/huge_memory.c
- index 292cedd9d692..b17c84095059 100644
- --- a/mm/huge_memory.c
- +++ b/mm/huge_memory.c
- @@ -2386,10 +2386,9 @@ static bool hugepage_vma_check(struct vm_area_struct *vma)
- * value (scan code).
- */
- -static int hugepage_vma_revalidate(struct mm_struct *mm,
- - struct vm_area_struct *vma,
- - unsigned long address)
- +static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address)
- {
- + struct vm_area_struct *vma;
- unsigned long hstart, hend;
- if (unlikely(khugepaged_test_exit(mm)))
- @@ -2438,7 +2437,7 @@ static bool __collapse_huge_page_swapin(struct mm_struct *mm,
- if (ret & VM_FAULT_RETRY) {
- down_read(&mm->mmap_sem);
- /* vma is no longer available, don't continue to swapin */
- - if (hugepage_vma_revalidate(mm, vma, address))
- + if (hugepage_vma_revalidate(mm, address))
- return false;
- }
- if (ret & VM_FAULT_ERROR) {
- @@ -2492,7 +2491,7 @@ static void collapse_huge_page(struct mm_struct *mm,
- swap = get_mm_counter(mm, MM_SWAPENTS);
- curr_allocstall = sum_vm_event(ALLOCSTALL);
- down_read(&mm->mmap_sem);
- - result = hugepage_vma_revalidate(mm, vma, address);
- + result = hugepage_vma_revalidate(mm, address);
- if (result)
- goto out;
- @@ -2525,7 +2524,7 @@ static void collapse_huge_page(struct mm_struct *mm,
- * handled by the anon_vma lock + PG_lock.
- */
- down_write(&mm->mmap_sem);
- - result = hugepage_vma_revalidate(mm, vma, address);
- + result = hugepage_vma_revalidate(mm, address);
- if (result)
- goto out;
Advertisement
Add Comment
Please, Sign In to add comment