lkml.org 
[lkml]   [2019]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 02/13] x86/mm: Add p?d_large() definitions
On Thu, Feb 21, 2019 at 11:34:51AM +0000, Steven Price wrote:
> Exposing the pud/pgd levels of the page tables to walk_page_range() means
> we may come across the exotic large mappings that come with large areas
> of contiguous memory (such as the kernel's linear map).
>
> Expose p?d_large() from each architecture to detect these large mappings.
>
> x86 already has these defined as inline functions, add a macro of the
> same name so we don't end up with the generic version too.
>
> Signed-off-by: James Morse <james.morse@arm.com>
> Signed-off-by: Steven Price <steven.price@arm.com>
> ---
> arch/x86/include/asm/pgtable.h | 3 +++
> arch/x86/mm/dump_pagetables.c | 3 +++
> 2 files changed, 6 insertions(+)
>
> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
> index 2779ace16d23..3695f6acb6af 100644
> --- a/arch/x86/include/asm/pgtable.h
> +++ b/arch/x86/include/asm/pgtable.h
> @@ -234,6 +234,7 @@ static inline int pmd_large(pmd_t pte)
> {
> return pmd_flags(pte) & _PAGE_PSE;
> }
> +#define pmd_large(x) pmd_large(x)
>
> #ifdef CONFIG_TRANSPARENT_HUGEPAGE
> static inline int pmd_trans_huge(pmd_t pmd)
> @@ -873,6 +874,7 @@ static inline int pud_large(pud_t pud)
> return 0;
> }
> #endif /* CONFIG_PGTABLE_LEVELS > 2 */
> +#define pud_large(x) pud_large(x)

Nit: we usually do this in form of

#define pud_large pud_large

and before body of the inline function.

--
Kirill A. Shutemov
\
 
 \ /
  Last update: 2019-02-21 15:22    [W:6.173 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site