From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: zi.yan@sent.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: benh@kernel.crashing.org, mgorman@techsingularity.net,
kirill.shutemov@linux.intel.com, akpm@linux-foundation.org,
dave.hansen@linux.intel.com, n-horiguchi@ah.jp.nec.com,
Zi Yan <zi.yan@cs.rutgers.edu>
Subject: Re: [PATCH v1 12/12] mm: ppc64: Add THP migration support for ppc64.
Date: Fri, 30 Sep 2016 10:48:09 +0530 [thread overview]
Message-ID: <87k2duaru6.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <20160926152234.14809-13-zi.yan@sent.com>
zi.yan@sent.com writes:
> From: Zi Yan <zi.yan@cs.rutgers.edu>
>
> Signed-off-by: Zi Yan <zi.yan@cs.rutgers.edu>
> ---
> arch/powerpc/Kconfig | 4 ++++
> arch/powerpc/include/asm/book3s/64/pgtable.h | 23 +++++++++++++++++++++++
> 2 files changed, 27 insertions(+)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 927d2ab..84ffd4c 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -553,6 +553,10 @@ config ARCH_SPARSEMEM_DEFAULT
> config SYS_SUPPORTS_HUGETLBFS
> bool
>
> +config ARCH_ENABLE_THP_MIGRATION
> + def_bool y
> + depends on PPC64 && TRANSPARENT_HUGEPAGE && MIGRATION
> +
> source "mm/Kconfig"
>
> config ARCH_MEMORY_PROBE
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index 263bf39..9dee0467 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -521,7 +521,9 @@ static inline bool pte_user(pte_t pte)
> * Clear bits not found in swap entries here.
> */
> #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) & ~_PAGE_PTE })
> +#define __pmd_to_swp_entry(pte) ((swp_entry_t) { pmd_val((pte)) & ~_PAGE_PTE })
> #define __swp_entry_to_pte(x) __pte((x).val | _PAGE_PTE)
> +#define __swp_entry_to_pmd(x) __pmd((x).val | _PAGE_PTE)
We definitely need a comment around that. This will work only for 64K
linux page size, on 4k we may consider it a hugepd directory entry. But
This should be ok because we support THP only with 64K linux page size.
Hence my suggestion to add proper comments or move it to right headers.
>
> #ifdef CONFIG_MEM_SOFT_DIRTY
> #define _PAGE_SWP_SOFT_DIRTY (1UL << (SWP_TYPE_BITS + _PAGE_BIT_SWAP_TYPE))
> @@ -662,6 +664,10 @@ static inline int pmd_bad(pmd_t pmd)
> return radix__pmd_bad(pmd);
> return hash__pmd_bad(pmd);
> }
> +static inline int __pmd_present(pmd_t pte)
> +{
> + return !!(pmd_val(pte) & _PAGE_PRESENT);
> +}
>
> static inline void pud_set(pud_t *pudp, unsigned long val)
> {
> @@ -850,6 +856,23 @@ static inline pte_t *pmdp_ptep(pmd_t *pmd)
> #define pmd_soft_dirty(pmd) pte_soft_dirty(pmd_pte(pmd))
> #define pmd_mksoft_dirty(pmd) pte_pmd(pte_mksoft_dirty(pmd_pte(pmd)))
> #define pmd_clear_soft_dirty(pmd) pte_pmd(pte_clear_soft_dirty(pmd_pte(pmd)))
> +
> +#ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION
> +static inline pmd_t pmd_swp_mksoft_dirty(pmd_t pmd)
> +{
> + return pte_pmd(pte_swp_mksoft_dirty(pmd_pte(pmd)));
> +}
> +
> +static inline int pmd_swp_soft_dirty(pmd_t pmd)
> +{
> + return pte_swp_soft_dirty(pmd_pte(pmd));
> +}
> +
> +static inline pmd_t pmd_swp_clear_soft_dirty(pmd_t pmd)
> +{
> + return pte_pmd(pte_swp_clear_soft_dirty(pmd_pte(pmd)));
> +}
> +#endif
> #endif /* CONFIG_HAVE_ARCH_SOFT_DIRTY */
>
> #ifdef CONFIG_NUMA_BALANCING
Did we test this with Radix config ? If not I will suggest we hold off
the ppc64 patch and you can merge rest of the changes.
-aneesh
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-09-30 5:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-26 15:22 [PATCH v1 00/12] mm: THP migration support zi.yan
2016-09-26 15:22 ` [PATCH v1 01/12] mm: mempolicy: add queue_pages_node_check() zi.yan
2016-09-26 15:22 ` [PATCH v1 02/12] mm: thp: introduce CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION zi.yan
2016-09-26 15:22 ` [PATCH v1 03/12] mm: thp: add helpers related to thp/pmd migration zi.yan
2016-09-26 15:22 ` [PATCH v1 04/12] mm: thp: enable thp migration in generic path zi.yan
2016-09-26 15:22 ` [PATCH v1 05/12] mm: thp: check pmd migration entry in common path zi.yan
2016-09-26 15:22 ` [PATCH v1 06/12] mm: soft-dirty: keep soft-dirty bits over thp migration zi.yan
2016-09-26 15:22 ` [PATCH v1 07/12] mm: hwpoison: fix race between unpoisoning and freeing migrate source page zi.yan
2016-09-26 15:22 ` [PATCH v1 08/12] mm: hwpoison: soft offline supports thp migration zi.yan
2016-09-26 15:22 ` [PATCH v1 09/12] mm: mempolicy: mbind and migrate_pages support " zi.yan
2016-09-26 15:22 ` [PATCH v1 10/12] mm: migrate: move_pages() supports " zi.yan
2016-09-26 15:22 ` [PATCH v1 11/12] mm: memory_hotplug: memory hotremove " zi.yan
2016-09-26 15:22 ` [PATCH v1 12/12] mm: ppc64: Add THP migration support for ppc64 zi.yan
2016-09-30 0:02 ` Balbir Singh
2016-09-30 5:18 ` Aneesh Kumar K.V [this message]
2016-09-26 15:38 ` [PATCH v1 00/12] THP migration support Zi Yan
2016-09-29 8:25 ` Naoya Horiguchi
2016-09-30 2:32 ` Zi Yan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k2duaru6.fsf@linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=dave.hansen@linux.intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=zi.yan@cs.rutgers.edu \
--cc=zi.yan@sent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).