Linus Torvalds writes: (Summary) The "page_to_pfn()"
logic can be pretty expensive (exactly for the sparsemem case, but
per-node DISCOTIGMEM has some complexity too.
per-node DISCOTIGMEM has some complexity too.
So I'd prefer to make that explicit, perhaps by having a helper function that does this something like
function that does this something like
static inline bool pfn_in_hpage(unsigned long pfn, struct page *hpage)
per-node DISCOTIGMEM has some complexity too.
So I'd prefer to make that explicit, perhaps by having a helper function that does this something like
function that does this something like
static inline bool pfn_in_hpage(unsigned long pfn, struct page *hpage)
{ unsigned long hpage_pfn = page_to_pfn(hpage); return pfn >= hpage_pfn && pfn - hpage_pfn <