Re: [PATCH] mm/hugetlb: get rid of page_hstate()

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

 



On Wed, Jul 19, 2023 at 10:59:44AM -0700, Sidhartha Kumar wrote:
> -			skip_pages = compound_nr(head) - (page - head);
> +			skip_pages = folio_nr_pages(folio) - (page - &folio->page);

It turns out that you can't do (page - head) under all configs.  It
works on all common ones, but the safe way to do what you want here is:

			skip_pages = folio_nr_pages(folio) -
					folio_page_idx(folio, page);




[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