[PATCH 1/2] arm64/mm: Change THP helpers to comply with generic MM semantics

Catalin Marinas catalin.marinas at arm.com
Tue Sep 8 07:32:11 EDT 2020


On Tue, Sep 08, 2020 at 03:48:08PM +0530, Anshuman Khandual wrote:
> On 09/03/2020 10:26 PM, Catalin Marinas wrote:
> > On Mon, Aug 17, 2020 at 02:49:43PM +0530, Anshuman Khandual wrote:
> >> pmd_present() and pmd_trans_huge() are expected to behave in the following
> >> manner during various phases of a given PMD. It is derived from a previous
> >> detailed discussion on this topic [1] and present THP documentation [2].
> >>
> >> pmd_present(pmd):
> >>
> >> - Returns true if pmd refers to system RAM with a valid pmd_page(pmd)
> >> - Returns false if pmd does not refer to system RAM - Invalid pmd_page(pmd)
> > 
> > The second bullet doesn't make much sense. If you have a pmd mapping of
> > some I/O memory, pmd_present() still returns true (as does
> > pte_present()).
> 
> Derived this from an earlier discussion (https://lkml.org/lkml/2018/10/17/231)
> but current representation here might not be accurate.
> 
> Would this be any better ?
> 
> pmd_present(pmd):
> 
> - Returns true if pmd refers to system RAM with a valid pmd_page(pmd)
> - Returns false if pmd refers to a migration or swap entry

Yes, that's better

-- 
Catalin



More information about the linux-arm-kernel mailing list