lkml.org 
[lkml]   [2024]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1 2/2] fs/proc/task_mmu: convert smaps_hugetlb_range() to work on folios
From
On 17.04.24 14:09, Oscar Salvador wrote:
> On Wed, Apr 17, 2024 at 11:23:13AM +0200, David Hildenbrand wrote:
>> Let's get rid of another page_mapcount() check and simply use
>> folio_likely_mapped_shared(), which is precise for hugetlb folios.
>>
>> While at it, use huge_ptep_get() + pte_page() instead of ptep_get() +
>> vm_normal_page(), just like we do in pagemap_hugetlb_range().
>
> That is fine because vm_normal_page() tries to be clever about mappings which
> hugetlb does not support, right?

Right, using vm_normal_page() is even completely bogus. Usually (but not
always) we have PMDs/PUDs and not PTEs for mapping hugetlb pages --
where vm_normal_folio_pmd() would be the right thing to do.

That's also the reason why hugetlb.c has not a single user of
vm_normal_page() and friends ... it doesn't apply to hugetlb, but likely
also isn't currently harmful to use it.

--
Cheers,

David / dhildenb


\
 
 \ /
  Last update: 2024-04-17 14:18    [W:0.116 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site