Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934142AbbFPJdP (ORCPT ); Tue, 16 Jun 2015 05:33:15 -0400 Received: from mail.kernel.org ([198.145.29.136]:54543 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756669AbbFPIl3 (ORCPT ); Tue, 16 Jun 2015 04:41:29 -0400 From: lizf@kernel.org To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Naoya Horiguchi , Hugh Dickins , James Hogan , David Rientjes , Mel Gorman , Johannes Weiner , Michal Hocko , Rik van Riel , Andrea Arcangeli , Luiz Capitulino , Nishanth Aravamudan , Lee Schermerhorn , Steve Capper , Andrew Morton , Linus Torvalds , Zefan Li Subject: [PATCH 3.4 029/172] mm/hugetlb: add migration entry check in __unmap_hugepage_range Date: Tue, 16 Jun 2015 16:34:43 +0800 Message-Id: <1434443826-4929-29-git-send-email-lizf@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434443587-4599-1-git-send-email-lizf@kernel.org> References: <1434443587-4599-1-git-send-email-lizf@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2213 Lines: 63 From: Naoya Horiguchi 3.4.108-rc1 review patch. If anyone has any objections, please let me know. ------------------ commit 9fbc1f635fd0bd28cb32550211bf095753ac637a upstream. If __unmap_hugepage_range() tries to unmap the address range over which hugepage migration is on the way, we get the wrong page because pte_page() doesn't work for migration entries. This patch simply clears the pte for migration entries as we do for hwpoison entries. Fixes: 290408d4a2 ("hugetlb: hugepage migration core") Signed-off-by: Naoya Horiguchi Cc: Hugh Dickins Cc: James Hogan Cc: David Rientjes Cc: Mel Gorman Cc: Johannes Weiner Cc: Michal Hocko Cc: Rik van Riel Cc: Andrea Arcangeli Cc: Luiz Capitulino Cc: Nishanth Aravamudan Cc: Lee Schermerhorn Cc: Steve Capper Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds [lizf: Backported to 3.4: - adjust context - update the comment that we doesn't clear pte here] Signed-off-by: Zefan Li --- mm/hugetlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 5f12dba..bc36e28 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2401,9 +2401,10 @@ void __unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, continue; /* - * HWPoisoned hugepage is already unmapped and dropped reference + * Migrating hugepage or HWPoisoned hugepage is already + * unmapped and its refcount is dropped */ - if (unlikely(is_hugetlb_entry_hwpoisoned(pte))) + if (unlikely(!pte_present(pte))) continue; page = pte_page(pte); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/