linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org
Cc: hughd@google.com, kirill@shutemov.name,
	n-horiguchi@ah.jp.nec.com, akpm@linux-foundation.org,
	mgorman@techsingularity.net, aneesh.kumar@linux.vnet.ibm.com,
	mpe@ellerman.id.au
Subject: [RFC 7/9] powerpc/hugetlb: Change follow_huge_* routines for BOOK3S 64K
Date: Wed,  9 Mar 2016 17:40:48 +0530	[thread overview]
Message-ID: <1457525450-4262-7-git-send-email-khandual@linux.vnet.ibm.com> (raw)
In-Reply-To: <1457525450-4262-1-git-send-email-khandual@linux.vnet.ibm.com>

With this change, BOOK3S 64K platforms will not use 'follow_huge_addr'
function any more and always return ERR_PTR(-ENIVAL), hence skipping
the BUG_ON(flags & FOLL_GET) test in 'follow_page_mask' function. These
platforms will then fall back on generic follow_huge_* functions for
everything else. While being here, also added 'follow_huge_pgd' function
which was missing earlier.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
 arch/powerpc/mm/hugetlbpage.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index f6e4712..89b748a 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -631,6 +631,10 @@ follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
 	unsigned long mask, flags;
 	struct page *page = ERR_PTR(-EINVAL);
 
+#if defined(CONFIG_PPC_64K_PAGES) && defined(CONFIG_PPC_BOOK3S_64)
+	return ERR_PTR(-EINVAL);
+#endif
+
 	local_irq_save(flags);
 	ptep = find_linux_pte_or_hugepte(mm->pgd, address, &is_thp, &shift);
 	if (!ptep)
@@ -658,6 +662,7 @@ no_page:
 	return page;
 }
 
+#if !defined(CONFIG_PPC_64K_PAGES) || !defined(CONFIG_PPC_BOOK3S_64)
 struct page *
 follow_huge_pmd(struct mm_struct *mm, unsigned long address,
 		pmd_t *pmd, int write)
@@ -674,6 +679,15 @@ follow_huge_pud(struct mm_struct *mm, unsigned long address,
 	return NULL;
 }
 
+struct page *
+follow_huge_pgd(struct mm_struct *mm, unsigned long address,
+		pgd_t *pgd, int write)
+{
+	BUG();
+	return NULL;
+}
+#endif /* !defined(CONFIG_PPC_64K_PAGE) || !defined(CONFIG_BOOK3S_64) */
+
 static unsigned long hugepte_addr_end(unsigned long addr, unsigned long end,
 				      unsigned long sz)
 {
-- 
2.1.0

  parent reply	other threads:[~2016-03-09 12:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 12:10 [RFC 1/9] mm/hugetlb: Make GENERAL_HUGETLB functions PGD implementation aware Anshuman Khandual
2016-03-09 12:10 ` [RFC 2/9] mm/hugetlb: Add follow_huge_pgd function Anshuman Khandual
2016-03-11  3:02   ` Anshuman Khandual
2016-03-09 12:10 ` [RFC 3/9] mm/gup: Make follow_page_mask function PGD implementation aware Anshuman Khandual
2016-03-11  3:03   ` Anshuman Khandual
2016-03-09 12:10 ` [RFC 4/9] powerpc/mm: Split huge_pte_alloc function for BOOK3S 64K Anshuman Khandual
2016-03-09 19:55   ` Aneesh Kumar K.V
2016-03-10  5:33     ` Anshuman Khandual
2016-03-09 12:10 ` [RFC 5/9] powerpc/mm: Split huge_pte_offset " Anshuman Khandual
2016-03-09 22:57   ` Dave Hansen
2016-03-10  3:37     ` Anshuman Khandual
2016-03-09 12:10 ` [RFC 6/9] powerpc/hugetlb: Enable ARCH_WANT_GENERAL_HUGETLB " Anshuman Khandual
2016-03-09 19:58   ` Aneesh Kumar K.V
2016-03-10  5:12     ` Anshuman Khandual
2016-03-21  9:55   ` Rui Teng
2016-03-09 12:10 ` Anshuman Khandual [this message]
2016-03-09 12:10 ` [RFC 8/9] powerpc/mm: Enable HugeTLB page migration Anshuman Khandual
2016-03-09 12:10 ` [RFC 9/9] selfttest/powerpc: Add memory page migration tests Anshuman Khandual
2016-03-09 20:01   ` Aneesh Kumar K.V
2016-03-10  5:05     ` Anshuman Khandual
2016-03-11  3:01 ` [RFC 1/9] mm/hugetlb: Make GENERAL_HUGETLB functions PGD implementation aware Anshuman Khandual
2016-03-14 20:29   ` Andrew Morton

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=1457525450-4262-7-git-send-email-khandual@linux.vnet.ibm.com \
    --to=khandual@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=hughd@google.com \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mgorman@techsingularity.net \
    --cc=mpe@ellerman.id.au \
    --cc=n-horiguchi@ah.jp.nec.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).