Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751490AbdFAIRM (ORCPT ); Thu, 1 Jun 2017 04:17:12 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:32883 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751090AbdFAIRI (ORCPT ); Thu, 1 Jun 2017 04:17:08 -0400 From: Naoya Horiguchi To: linux-mm@kvack.org Cc: Andrew Morton , Michal Hocko , "Aneesh Kumar K.V" , Anshuman Khandual , linux-kernel@vger.kernel.org, Naoya Horiguchi Subject: [PATCH v1 1/9] mm: hugetlb: prevent reuse of hwpoisoned free hugepages Date: Thu, 1 Jun 2017 17:16:51 +0900 Message-Id: <1496305019-5493-2-git-send-email-n-horiguchi@ah.jp.nec.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1496305019-5493-1-git-send-email-n-horiguchi@ah.jp.nec.com> References: <1496305019-5493-1-git-send-email-n-horiguchi@ah.jp.nec.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1501 Lines: 46 We no longer use MIGRATE_ISOLATE to prevent reuse of hwpoison hugepages as we did before. So current dequeue_huge_page_node() doesn't work as intended because it still uses is_migrate_isolate_page() for this check. This patch fixes it with PageHWPoison flag. Signed-off-by: Naoya Horiguchi --- mm/hugetlb.c | 3 +-- mm/memory-failure.c | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git v4.12-rc3/mm/hugetlb.c v4.12-rc3_patched/mm/hugetlb.c index e582887..6d6c659 100644 --- v4.12-rc3/mm/hugetlb.c +++ v4.12-rc3_patched/mm/hugetlb.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -872,7 +871,7 @@ static struct page *dequeue_huge_page_node(struct hstate *h, int nid) struct page *page; list_for_each_entry(page, &h->hugepage_freelists[nid], lru) - if (!is_migrate_isolate_page(page)) + if (!PageHWPoison(page)) break; /* * if 'non-isolated free hugepage' not found on the list, diff --git v4.12-rc3/mm/memory-failure.c v4.12-rc3_patched/mm/memory-failure.c index 2527dfed..6c1a7c9 100644 --- v4.12-rc3/mm/memory-failure.c +++ v4.12-rc3_patched/mm/memory-failure.c @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include -- 2.7.0