Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756765AbbGTOdK (ORCPT ); Mon, 20 Jul 2015 10:33:10 -0400 Received: from mga11.intel.com ([192.55.52.93]:50426 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932326AbbGTOVW (ORCPT ); Mon, 20 Jul 2015 10:21:22 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,508,1432623600"; d="scan'208";a="750785403" From: "Kirill A. Shutemov" To: Andrew Morton , Andrea Arcangeli , Hugh Dickins Cc: Dave Hansen , Mel Gorman , Rik van Riel , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Steve Capper , "Aneesh Kumar K.V" , Johannes Weiner , Michal Hocko , Jerome Marchand , Sasha Levin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A. Shutemov" Subject: [PATCHv9 08/36] khugepaged: ignore pmd tables with THP mapped with ptes Date: Mon, 20 Jul 2015 17:20:41 +0300 Message-Id: <1437402069-105900-9-git-send-email-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1437402069-105900-1-git-send-email-kirill.shutemov@linux.intel.com> References: <1437402069-105900-1-git-send-email-kirill.shutemov@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1614 Lines: 46 Prepare khugepaged to see compound pages mapped with pte. For now we won't collapse the pmd table with such pte. khugepaged is subject for future rework wrt new refcounting. Signed-off-by: Kirill A. Shutemov Tested-by: Sasha Levin Tested-by: Aneesh Kumar K.V Acked-by: Jerome Marchand Acked-by: Vlastimil Babka --- mm/huge_memory.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index eebb518a7267..bef7b3595fbe 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2732,6 +2732,11 @@ static int khugepaged_scan_pmd(struct mm_struct *mm, page = vm_normal_page(vma, _address, pteval); if (unlikely(!page)) goto out_unmap; + + /* TODO: teach khugepaged to collapse THP mapped with pte */ + if (PageCompound(page)) + goto out_unmap; + /* * Record which node the original page is from and save this * information to khugepaged_node_load[]. @@ -2742,7 +2747,6 @@ static int khugepaged_scan_pmd(struct mm_struct *mm, if (khugepaged_scan_abort(node)) goto out_unmap; khugepaged_node_load[node]++; - VM_BUG_ON_PAGE(PageCompound(page), page); if (!PageLRU(page) || PageLocked(page) || !PageAnon(page)) goto out_unmap; /* -- 2.1.4 -- 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/