[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1295591340-1862-3-git-send-email-n-horiguchi@ah.jp.nec.com>
Date: Fri, 21 Jan 2011 15:28:55 +0900
From: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To: Andi Kleen <tatsu@...jp.nec.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Wu Fengguang <fengguang.wu@...el.com>,
Mel Gorman <mel@....ul.ie>,
Christoph Lameter <cl@...ux-foundation.org>,
Huang Ying <ying.huang@...el.com>,
Fernando Luis Vazquez Cao <fernando@....ntt.co.jp>,
tony.luck@...el.com, LKML <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>
Subject: [PATCH 2/7] check hugepage swap entry in get_user_pages_fast()
When the hugepage associated with a given address is HWPOISONed
or under page migration, get_user_pages_fast() need to fall back
to slow path in order to make the page fault fail (when HWPOISONed)
or to wait for migration completion (when under migration.)
Signed-off-by: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
---
arch/x86/mm/gup.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git v2.6.38-rc1/arch/x86/mm/gup.c v2.6.38-rc1/arch/x86/mm/gup.c
index dbe34b9..93b74dd 100644
--- v2.6.38-rc1/arch/x86/mm/gup.c
+++ v2.6.38-rc1/arch/x86/mm/gup.c
@@ -176,6 +176,15 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
*/
if (pmd_none(pmd) || pmd_trans_splitting(pmd))
return 0;
+ /*
+ * PMD can be in swap entry style when the hugepage
+ * pointed to by it is hwpoisoned or under migration.
+ * Because the swap entry format has no flag showing
+ * the page size, pmd_large() cannot detect it.
+ * So then we just fall back to the slow path.
+ */
+ if (unlikely(!pmd_present(pmd)))
+ return 0;
if (unlikely(pmd_large(pmd))) {
if (!gup_huge_pmd(pmd, addr, next, write, pages, nr))
return 0;
--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists