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);