Re: [PATCH v4] mm/page_vma_mapped.c: Explicitly compare pfn for normal, hugetlbfs and THP page

Li Xinhai
2020-01-14T14:24:23Z

On 2020-01-14 at 06:38 Andrew Morton wrote:
>On Sat, 11 Jan 2020 10:18:05 +0000 Li Xinhai <lixinhai.lxh@gmail.com> wrote:
>
>> When check_pte, pfn of normal, hugetlbfs and THP page need be compared.
>> The current implementation apply comparison as
>> - normal 4K page: page_pfn <= pfn < page_pfn + 1
>> - hugetlbfs page:  page_pfn <= pfn < page_pfn + HPAGE_PMD_NR
>> - THP page: page_pfn <= pfn < page_pfn + HPAGE_PMD_NR
>> in pfn_in_hpage. For hugetlbfs page, it should be
>> page_pfn == pfn
>
>Does this have any runtime effects?
No impaction to current behavior, just make the code clear.

>
>> Now, change pfn_in_hpage to pfn_is_match to highlight that comparison
>> is not only for THP and explicitly compare for these cases.