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

From: Ralph Campbell
Date: Thu Sep 03 2020 - 13:31:50 EST



On 9/3/20 9:56 AM, 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()).

diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h
index 4d867c6446c4..28792fdd9627 100644
--- a/arch/arm64/include/asm/pgtable-prot.h
+++ b/arch/arm64/include/asm/pgtable-prot.h
@@ -19,6 +19,13 @@
#define PTE_DEVMAP (_AT(pteval_t, 1) << 57)
#define PTE_PROT_NONE (_AT(pteval_t, 1) << 58) /* only when !PTE_VALID */
+/*
+ * This help indicate that the entry is present i.e pmd_page()

Nit: add another . after i.e

Another nit: "This help indicate" => "This helper indicates"

Maybe I should look at the series more. :-)