mm, page_vma_mapped: Introduce pfn_in_hpage()
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Mon, 22 Jan 2018 09:22:30 +0000 (12:22 +0300)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Jan 2018 20:15:57 +0000 (12:15 -0800)
commit7222708e823afc98dfb769d36bf2f26b6420b7ce
tree574d64c2b67d294ed4299f35b2cb98ac7cdd6053
parent0d665e7b109d512b7cae3ccef6e8654714887844
mm, page_vma_mapped: Introduce pfn_in_hpage()

The new helper would check if the pfn belongs to the page. For huge
pages it checks if the PFN is within range covered by the huge page.

The helper is used in check_pte(). The original code the helper replaces
had two call to page_to_pfn(). page_to_pfn() is relatively costly.

Although current GCC is able to optimize code to have one call, it's
better to do this explicitly.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_vma_mapped.c