[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200903165853.GD31409@gaia>
Date: Thu, 3 Sep 2020 17:58:54 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Anshuman Khandual <anshuman.khandual@....com>
Cc: linux-mm@...ck.org, linux-arm-kernel@...ts.infradead.org,
will@...nel.org, akpm@...ux-foundation.org,
Mark Rutland <mark.rutland@....com>,
Marc Zyngier <maz@...nel.org>,
Suzuki Poulose <suzuki.poulose@....com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] arm64/mm: Enable THP migration
On Mon, Aug 17, 2020 at 02:49:44PM +0530, Anshuman Khandual wrote:
> In certain page migration situations, a THP page can be migrated without
> being split into it's constituent subpages. This saves time required to
> split a THP and put it back together when required. But it also saves an
> wider address range translation covered by a single TLB entry, reducing
> future page fault costs.
>
> A previous patch changed platform THP helpers per generic memory semantics,
> clearing the path for THP migration support. This adds two more THP helpers
> required to create PMD migration swap entries. Now just enable HP migration
s/HP/THP/
> via ARCH_ENABLE_THP_MIGRATION.
>
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: Will Deacon <will@...nel.org>
> Cc: Mark Rutland <mark.rutland@....com>
> Cc: Marc Zyngier <maz@...nel.org>
> Cc: Suzuki Poulose <suzuki.poulose@....com>
> Cc: linux-arm-kernel@...ts.infradead.org
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual@....com>
> ---
> arch/arm64/Kconfig | 4 ++++
> arch/arm64/include/asm/pgtable.h | 5 +++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 6d232837cbee..e21b94061780 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1876,6 +1876,10 @@ config ARCH_ENABLE_HUGEPAGE_MIGRATION
> def_bool y
> depends on HUGETLB_PAGE && MIGRATION
>
> +config ARCH_ENABLE_THP_MIGRATION
> + def_bool y
> + depends on TRANSPARENT_HUGEPAGE
> +
> menu "Power management options"
>
> source "kernel/power/Kconfig"
> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> index 7aa69cace784..c54334bca4e2 100644
> --- a/arch/arm64/include/asm/pgtable.h
> +++ b/arch/arm64/include/asm/pgtable.h
> @@ -875,6 +875,11 @@ static inline pmd_t pmdp_establish(struct vm_area_struct *vma,
> #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
> #define __swp_entry_to_pte(swp) ((pte_t) { (swp).val })
>
> +#ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION
> +#define __pmd_to_swp_entry(pmd) ((swp_entry_t) { pmd_val(pmd) })
> +#define __swp_entry_to_pmd(swp) __pmd((swp).val)
> +#endif /* CONFIG_ARCH_ENABLE_THP_MIGRATION */
Reviewed-by: Catalin Marinas <catalin.marinas@....com>
Powered by blists - more mailing lists