]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita6801320b5f4fb004a19caaf7e2111657c0f5570
tree574d64c2b67d294ed4299f35b2cb98ac7cdd6053
parent0df8c49129525404dc600f6e2fa66a6e387e5b23
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