[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201113114510.GX2611@hirez.programming.kicks-ass.net>
Date: Fri, 13 Nov 2020 12:45:10 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: kan.liang@...ux.intel.com, mingo@...nel.org, acme@...nel.org,
mark.rutland@....com, alexander.shishkin@...ux.intel.com,
jolsa@...hat.com, eranian@...gle.com
Cc: christophe.leroy@...roup.eu, npiggin@...il.com,
linuxppc-dev@...ts.ozlabs.org, mpe@...erman.id.au, will@...nel.org,
willy@...radead.org, aneesh.kumar@...ux.ibm.com,
sparclinux@...r.kernel.org, davem@...emloft.net,
catalin.marinas@....com, linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org, ak@...ux.intel.com,
dave.hansen@...el.com, kirill.shutemov@...ux.intel.com
Subject: Re: [PATCH 2/5] mm: Introduce pXX_leaf_size()
On Fri, Nov 13, 2020 at 12:19:03PM +0100, Peter Zijlstra wrote:
> A number of architectures have non-pagetable aligned huge/large pages.
> For such architectures a leaf can actually be part of a larger TLB
> entry.
>
> Provide generic helpers to determine the TLB size of a page-table
> leaf.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
> include/linux/pgtable.h | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> --- a/include/linux/pgtable.h
> +++ b/include/linux/pgtable.h
> @@ -1536,4 +1536,20 @@ typedef unsigned int pgtbl_mod_mask;
> #define pmd_leaf(x) 0
> #endif
>
> +#ifndef pgd_leaf_size
> +#define pgd_leaf_size(x) PGD_SIZE
Argh, I lost a refresh, that should've been:
+#define pgd_leaf_size(x) (1ULL << PGDIR_SHIFT)
> +#endif
> +#ifndef p4d_leaf_size
> +#define p4d_leaf_size(x) P4D_SIZE
> +#endif
> +#ifndef pud_leaf_size
> +#define pud_leaf_size(x) PUD_SIZE
> +#endif
> +#ifndef pmd_leaf_size
> +#define pmd_leaf_size(x) PMD_SIZE
> +#endif
> +#ifndef pte_leaf_size
> +#define pte_leaf_size(x) PAGE_SIZE
> +#endif
> +
> #endif /* _LINUX_PGTABLE_H */
>
>
Powered by blists - more mailing lists