From patchwork Sun Jan 16 12:18:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 12714555 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83A14C433FE for ; Sun, 16 Jan 2022 12:38:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45F106B007B; Sun, 16 Jan 2022 07:38:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 347EC6B007D; Sun, 16 Jan 2022 07:38:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E86E6B007E; Sun, 16 Jan 2022 07:38:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0069.hostedemail.com [216.40.44.69]) by kanga.kvack.org (Postfix) with ESMTP id 0F7C66B007B for ; Sun, 16 Jan 2022 07:38:10 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C25BC944FD for ; Sun, 16 Jan 2022 12:38:09 +0000 (UTC) X-FDA: 79036102698.08.D623BD5 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id 6A79380004 for ; Sun, 16 Jan 2022 12:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=hGAUTyP3YKMieg4ukwDdxrEbr7Dqansun9ibaWHflPg=; b=HW9oxCyfqc71KCw4UsiP8admKH P+HlyOF17U8jSApjuJR0uuYs6F64te/Sm7bn23eCPLD4E0dyvrzI1/gVG48RSV9hgjWZ/8BFo/Q+S K/Zx4vNotJpvWiUhzJHBXsrLqIIiX+RtBh/Ja38sU7XSvFzK494p7w0TGL3FDgtE7MaQVJX3AOwdN KoJN671KIfzeswq2GOqK36nU5MUnI3MT6WFzlGgkwAklV0biF/fc37AI9x4x9n/em2J0Ul2hdbIzO GhLB8gSBucCj3Na56/oRSbP69i2BE9N/pkYQ5Ctka8VZXi37usF5yIHBVF8sURG50/SunS3iRcKmu aN97bUDA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n94UM-007FUh-SL; Sun, 16 Jan 2022 12:18:26 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: William Kucharski , Matthew Wilcox Subject: [PATCH 09/12] mm/readahead: Align file mappings for non-DAX Date: Sun, 16 Jan 2022 12:18:19 +0000 Message-Id: <20220116121822.1727633-10-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220116121822.1727633-1-willy@infradead.org> References: <20220116121822.1727633-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 6A79380004 X-Stat-Signature: 5p74b1kisy11cx1xkocbs45pomjaqcfx Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=HW9oxCyf; dmarc=none; spf=none (imf30.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam08 X-HE-Tag: 1642336689-915010 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: William Kucharski When we have the opportunity to use PMDs 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 f58524394dc1..28c29a0d854b 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -582,13 +582,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);