Message ID | 20220706235936.2197195-2-zokeefe@google.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm: userspace hugepage collapse | expand |
On Wed, Jul 6, 2022 at 5:06 PM Zach O'Keefe <zokeefe@google.com> wrote: > > transhuge_vma_suitable() is called twice in hugepage_vma_revalidate() > path. Remove the first check, and rely on the second check inside > hugepage_vma_check(). > > Signed-off-by: Zach O'Keefe <zokeefe@google.com> > --- > mm/khugepaged.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/mm/khugepaged.c b/mm/khugepaged.c > index cfe231c5958f..5269d15e20f6 100644 > --- a/mm/khugepaged.c > +++ b/mm/khugepaged.c > @@ -918,8 +918,6 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address, > if (!vma) > return SCAN_VMA_NULL; > > - if (!transhuge_vma_suitable(vma, address)) > - return SCAN_ADDRESS_RANGE; It seems this is the only user of SCAN_ADDRESS_RANGE, so SCAN_ADDRESS_RANGE could be deleted as well. > if (!hugepage_vma_check(vma, vma->vm_flags, false, false)) > return SCAN_VMA_CHECK; > /* > -- > 2.37.0.rc0.161.g10f37bed90-goog >
On Jul 11 13:38, Yang Shi wrote: > On Wed, Jul 6, 2022 at 5:06 PM Zach O'Keefe <zokeefe@google.com> wrote: > > > > transhuge_vma_suitable() is called twice in hugepage_vma_revalidate() > > path. Remove the first check, and rely on the second check inside > > hugepage_vma_check(). > > > > Signed-off-by: Zach O'Keefe <zokeefe@google.com> > > --- > > mm/khugepaged.c | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/mm/khugepaged.c b/mm/khugepaged.c > > index cfe231c5958f..5269d15e20f6 100644 > > --- a/mm/khugepaged.c > > +++ b/mm/khugepaged.c > > @@ -918,8 +918,6 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address, > > if (!vma) > > return SCAN_VMA_NULL; > > > > - if (!transhuge_vma_suitable(vma, address)) > > - return SCAN_ADDRESS_RANGE; > > It seems this is the only user of SCAN_ADDRESS_RANGE, so > SCAN_ADDRESS_RANGE could be deleted as well. > Good catch! Was able to remove this. Thanks again, Zach > > if (!hugepage_vma_check(vma, vma->vm_flags, false, false)) > > return SCAN_VMA_CHECK; > > /* > > -- > > 2.37.0.rc0.161.g10f37bed90-goog > >
diff --git a/mm/khugepaged.c b/mm/khugepaged.c index cfe231c5958f..5269d15e20f6 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -918,8 +918,6 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address, if (!vma) return SCAN_VMA_NULL; - if (!transhuge_vma_suitable(vma, address)) - return SCAN_ADDRESS_RANGE; if (!hugepage_vma_check(vma, vma->vm_flags, false, false)) return SCAN_VMA_CHECK; /*
transhuge_vma_suitable() is called twice in hugepage_vma_revalidate() path. Remove the first check, and rely on the second check inside hugepage_vma_check(). Signed-off-by: Zach O'Keefe <zokeefe@google.com> --- mm/khugepaged.c | 2 -- 1 file changed, 2 deletions(-)