Re: [PATCH v2 08/14] mm/khugepaged: Remove redundant pmd_devmap() check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 17, 2025 at 11:44:30AM +0200, David Hildenbrand wrote:
> On 16.06.25 13:58, Alistair Popple wrote:
> > The only users of pmd_devmap were device dax and fs dax. The check for
> > pmd_devmap() in check_pmd_state() is therefore redundant as callers
> > explicitly check for is_zone_device_page(), so this check can be dropped.
> > 
> 
> Looking again, is this true?
> 
> If we return "SCAN_SUCCEED", we assume there is a page table there that we
> can map and walk.
> 
> But I assume we can drop that check because nobody will ever set
> pmd_devmap() anymore?
> 
> So likely just the description+sibject of this patch should be adjusted.

Ugh. I wish I had've documented this better because it's all very "obvious",
but I think the description is still accurate. These devmap checks could never
have been hit and were therefore redundant, because in practice all callers call
thp_vma_allowable_order() either before or after check_pmd_state() (or both).

thp_vma_allowable_order() will eventually (in __thp_vma_allowable_orders())
check for a DAX VMA and bail. But yes, I should call that out in the patch
subject so I don't have to keep relearning this obvious fact :-)

> FWIW, I think check_pmd_state() should be changed to work on pmd_leaf() etc,
> but that's something for another day.

Sure, and I do appreciate these kind of remarks because sometimes I get bored
enough to come back and actually do them. Not very often ... but sometimes.

> -- 
> Cheers,
> 
> David / dhildenb
> 




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux