Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934623Ab3CNRyn (ORCPT ); Thu, 14 Mar 2013 13:54:43 -0400 Received: from mga14.intel.com ([143.182.124.37]:23908 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934562Ab3CNRtV (ORCPT ); Thu, 14 Mar 2013 13:49:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,845,1355126400"; d="scan'208";a="214771592" From: "Kirill A. Shutemov" To: Andrea Arcangeli , Andrew Morton , Al Viro , Hugh Dickins Cc: Wu Fengguang , Jan Kara , Mel Gorman , linux-mm@kvack.org, Andi Kleen , Matthew Wilcox , "Kirill A. Shutemov" , Hillf Danton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv2, RFC 29/30] thp: call __vma_adjust_trans_huge() for file-backed VMA Date: Thu, 14 Mar 2013 19:50:34 +0200 Message-Id: <1363283435-7666-30-git-send-email-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363283435-7666-1-git-send-email-kirill.shutemov@linux.intel.com> References: <1363283435-7666-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: 1401 Lines: 41 From: "Kirill A. Shutemov" Since we're going to have huge pages in page cache, we need to call __vma_adjust_trans_huge() for file-backed VMA, which potentially can contain huge pages. For now we call it for all VMAs with vm_ops->huge_fault defined. Probably later we will need to introduce a flag to indicate that the VMA has huge pages. Signed-off-by: Kirill A. Shutemov --- include/linux/huge_mm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index aa52c48..c6e3aef 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -161,9 +161,9 @@ static inline void vma_adjust_trans_huge(struct vm_area_struct *vma, unsigned long end, long adjust_next) { - if (!vma->anon_vma || vma->vm_ops) - return; - __vma_adjust_trans_huge(vma, start, end, adjust_next); + if ((vma->anon_vma && !vma->vm_ops) || + (vma->vm_ops && vma->vm_ops->huge_fault)) + __vma_adjust_trans_huge(vma, start, end, adjust_next); } static inline int hpage_nr_pages(struct page *page) { -- 1.7.10.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/