From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: benh@kernel.crashing.org, paulus@samba.org, linux-mm@kvack.org
Cc: linuxppc-dev@lists.ozlabs.org,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: [RFC PATCH 6/9] powerpc: mm: book3s: Disable hugepaged pmd format for book3s
Date: Tue, 22 Oct 2013 16:58:17 +0530 [thread overview]
Message-ID: <1382441300-1513-7-git-send-email-aneesh.kumar@linux.vnet.ibm.com> (raw)
In-Reply-To: <1382441300-1513-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
After commit e2b3d202d1dba8f3546ed28224ce485bc50010be we have the
below possible formats for pmd entry
(1) invalid (all zeroes)
(2) pointer to next table, as normal; bottom 6 bits == 0
(3) leaf pte for huge page, bottom two bits != 00
(4) hugepd pointer, bottom two bits == 00, next 4 bits indicate size of table
On book3s we don't really use the (4). For Numa balancing we need to
tag pmd entries that are pointer to next table with _PAGE_NUMA for
performance reason (9532fec118d485ea37ab6e3ea372d68cd8b4cd0d). This
patch enables that by disabling hugepd support for book3s if
NUMA_BALANCING is enabled. We ideally want to get rid of hugepd pointer
completely.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/page.h | 11 +++++++++++
arch/powerpc/mm/hugetlbpage.c | 8 +++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index b9f4262..791ab56 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -369,11 +369,22 @@ typedef struct { signed long pd; } hugepd_t;
#ifdef CONFIG_PPC_BOOK3S_64
static inline int hugepd_ok(hugepd_t hpd)
{
+#ifdef CONFIG_NUMA_BALANCING
+ /*
+ * In order to enable batch handling of pte numa faults, Numa balancing
+ * code use the _PAGE_NUMA bit even on pmd that is pointing to PTE PAGE.
+ * 9532fec118d485ea37ab6e3ea372d68cd8b4cd0d. After commit
+ * e2b3d202d1dba8f3546ed28224ce485bc50010be we really don't need to
+ * support hugepd for ppc64.
+ */
+ return 0;
+#else
/*
* hugepd pointer, bottom two bits == 00 and next 4 bits
* indicate size of table
*/
return (((hpd.pd & 0x3) == 0x0) && ((hpd.pd & HUGEPD_SHIFT_MASK) != 0));
+#endif
}
#else
static inline int hugepd_ok(hugepd_t hpd)
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index d67db4b..71bd214 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -235,8 +235,14 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz
if (!hpdp)
return NULL;
+#ifdef CONFIG_NUMA_BALANCING
+ /*
+ * We cannot support hugepd format with numa balancing support
+ * enabled.
+ */
+ return NULL;
+#endif
BUG_ON(!hugepd_none(*hpdp) && !hugepd_ok(*hpdp));
-
if (hugepd_none(*hpdp) && __hugepte_alloc(mm, hpdp, addr, pdshift, pshift))
return NULL;
--
1.8.3.2
next prev parent reply other threads:[~2013-10-22 12:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-22 11:28 [RFC PATCH 0/9] powerpc: mm: Numa faults support for ppc64 Aneesh Kumar K.V
2013-10-22 11:28 ` [RFC PATCH 1/9] powerpc: Use HPTE constants when updating hpte bits Aneesh Kumar K.V
2013-10-22 11:28 ` [RFC PATCH 2/9] powerpc: Free up _PAGE_COHERENCE for numa fault use later Aneesh Kumar K.V
2013-10-22 11:28 ` [RFC PATCH 3/9] mm: Move change_prot_numa outside CONFIG_ARCH_USES_NUMA_PROT_NONE Aneesh Kumar K.V
2013-10-22 11:28 ` [RFC PATCH 4/9] powerpc: mm: Only check for _PAGE_PRESENT in set_pte/pmd functions Aneesh Kumar K.V
2013-10-22 11:28 ` [RFC PATCH 5/9] powerpc: mm: book3s: Enable _PAGE_NUMA for book3s Aneesh Kumar K.V
2013-10-22 11:28 ` Aneesh Kumar K.V [this message]
2013-10-22 11:28 ` [RFC PATCH 7/9] mm: numafaults: Use change_pmd_protnuma for updating _PAGE_NUMA for regular pmds Aneesh Kumar K.V
2013-10-22 11:28 ` [RFC PATCH 8/9] powerpc: mm: Support setting _PAGE_NUMA bit on pmd entry which are pointer to PTE page Aneesh Kumar K.V
2013-10-22 11:28 ` [RFC PATCH 9/9] powerpc: mm: Enable numa faulting for hugepages Aneesh Kumar K.V
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=1382441300-1513-7-git-send-email-aneesh.kumar@linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
/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).