From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964800AbbCDQjk (ORCPT ); Wed, 4 Mar 2015 11:39:40 -0500 Received: from mga11.intel.com ([192.55.52.93]:46134 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933130AbbCDQd1 (ORCPT ); Wed, 4 Mar 2015 11:33:27 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,688,1418112000"; d="scan'208";a="686841656" From: "Kirill A. Shutemov" To: Andrew Morton , Andrea Arcangeli Cc: Dave Hansen , Hugh Dickins , Mel Gorman , Rik van Riel , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Steve Capper , "Aneesh Kumar K.V" , Johannes Weiner , Michal Hocko , Jerome Marchand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A. Shutemov" Subject: [PATCHv4 10/24] khugepaged: ignore pmd tables with THP mapped with ptes Date: Wed, 4 Mar 2015 18:32:58 +0200 Message-Id: <1425486792-93161-11-git-send-email-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1425486792-93161-1-git-send-email-kirill.shutemov@linux.intel.com> References: <1425486792-93161-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 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 --- 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 36e03eb9aa41..ff1282b1859c 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2747,6 +2747,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[]. @@ -2757,7 +2762,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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by kanga.kvack.org (Postfix) with ESMTP id 3A5C16B0074 for ; Wed, 4 Mar 2015 11:33:35 -0500 (EST) Received: by pdjp10 with SMTP id p10so21449129pdj.10 for ; Wed, 04 Mar 2015 08:33:35 -0800 (PST) Received: from mga09.intel.com (mga09.intel.com. [134.134.136.24]) by mx.google.com with ESMTP id er10si5701484pac.123.2015.03.04.08.33.26 for ; Wed, 04 Mar 2015 08:33:26 -0800 (PST) From: "Kirill A. Shutemov" Subject: [PATCHv4 10/24] khugepaged: ignore pmd tables with THP mapped with ptes Date: Wed, 4 Mar 2015 18:32:58 +0200 Message-Id: <1425486792-93161-11-git-send-email-kirill.shutemov@linux.intel.com> In-Reply-To: <1425486792-93161-1-git-send-email-kirill.shutemov@linux.intel.com> References: <1425486792-93161-1-git-send-email-kirill.shutemov@linux.intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Andrea Arcangeli Cc: Dave Hansen , Hugh Dickins , Mel Gorman , Rik van Riel , Vlastimil Babka , Christoph Lameter , Naoya Horiguchi , Steve Capper , "Aneesh Kumar K.V" , Johannes Weiner , Michal Hocko , Jerome Marchand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Kirill A. Shutemov" 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 --- 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 36e03eb9aa41..ff1282b1859c 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2747,6 +2747,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[]. @@ -2757,7 +2762,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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org