Re: [PATCH 5/7] mm: Replace hpage_nr_pages with thp_nr_pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 29, 2020 at 10:40:12AM -0700, Mike Kravetz wrote:
> > +++ b/mm/hugetlb.c
> > @@ -1593,7 +1593,7 @@ static struct address_space *_get_hugetlb_page_mapping(struct page *hpage)
> >  
> >  	/* Use first found vma */
> >  	pgoff_start = page_to_pgoff(hpage);
> > -	pgoff_end = pgoff_start + hpage_nr_pages(hpage) - 1;
> > +	pgoff_end = pgoff_start + thp_nr_pages(hpage) - 1;
> >  	anon_vma_interval_tree_foreach(avc, &anon_vma->rb_root,
> >  					pgoff_start, pgoff_end) {
> >  		struct vm_area_struct *vma = avc->vma;
> 
> Naming consistency is a good idea!
> 
> I was wondering why hugetlb code would be calling a 'thp related' routine.
> The reason is that hpage_nr_pages was incorrectly added (by me) to get the
> number of pages in a hugetlb page.  If the name of the routine was thp_nr_pages
> as proposed, I would not have made this mistake.
> 
> I will provide a patch to change the above hpage_nr_pages call to
> pages_per_huge_page(page_hstate()).

Thank you!  Clearly I wasn't thinking about this patch and just did a
mindless search-and-replace!  I should evaluate the other places where
I did this and see if any of them are wrong too.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux