From patchwork Fri May 29 02:58:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11577549 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35CB61392 for ; Fri, 29 May 2020 02:59:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10968207D3 for ; Fri, 29 May 2020 02:59:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="skBzEUGm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391680AbgE2C7g (ORCPT ); Thu, 28 May 2020 22:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407359AbgE2C6j (ORCPT ); Thu, 28 May 2020 22:58:39 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656A6C08C5C9; Thu, 28 May 2020 19:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=quJ3RC3U+b/nyG816tgLa2xDrJqk5JH49/UwuAMJF44=; b=skBzEUGmPctWWpVrNKDkxMoOgD pyLFnANfiPTVJnun523pYwSVbPS5oYdL4zUo5GK7YbNHR4dJ5hPw2n07akxr3SMTWlj1Gnbau20ZE e+WTO0bM8cGyMppUzZsZlCs6zY5NiuoRCqnsNpTfTSYGXaGTx6kHxQnvd0A/3k4Zuo9apOPYPKxuJ k8ek7/17oH6r/mOao76YstwOyFtDVHpM7vfiTB3Px23F6UpZr2lvHgpcxHuwYiE4aS0XymW3Dts7z ORMBjmpY3Vr/rZco1GwFqdfCCqd0REfBLcslUA5QqCAW310QdCMIqEO3nKk9vWOkUPGPMVmeECQKf 9cW8aofg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jeVE4-0008UA-3W; Fri, 29 May 2020 02:58:28 +0000 From: Matthew Wilcox To: linux-fsdevel@vger.kernel.org Cc: William Kucharski , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Matthew Wilcox Subject: [PATCH v5 39/39] mm: Align THP mappings for non-DAX Date: Thu, 28 May 2020 19:58:24 -0700 Message-Id: <20200529025824.32296-40-willy@infradead.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200529025824.32296-1-willy@infradead.org> References: <20200529025824.32296-1-willy@infradead.org> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org From: William Kucharski When we have the opportunity to use transparent huge pages to map a file, we want to follow the same rules as DAX. Signed-off-by: William Kucharski Signed-off-by: Matthew Wilcox (Oracle) --- mm/huge_memory.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 4c4f92349829..9b6f7b86bac7 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -577,13 +577,10 @@ unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr, unsigned long ret; loff_t off = (loff_t)pgoff << PAGE_SHIFT; - if (!IS_DAX(filp->f_mapping->host) || !IS_ENABLED(CONFIG_FS_DAX_PMD)) - goto out; - ret = __thp_get_unmapped_area(filp, addr, len, off, flags, PMD_SIZE); if (ret) return ret; -out: + return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags); } EXPORT_SYMBOL_GPL(thp_get_unmapped_area);