From mboxrd@z Thu Jan 1 00:00:00 1970 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 58202C433F5 for ; Fri, 4 Feb 2022 20:00:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EA5056B009F; Fri, 4 Feb 2022 14:59:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C5D568D000E; Fri, 4 Feb 2022 14:59:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E606F8D0010; Fri, 4 Feb 2022 14:59:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id 9A0816B009F for ; Fri, 4 Feb 2022 14:59:09 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5938D18259C27 for ; Fri, 4 Feb 2022 19:59:09 +0000 (UTC) X-FDA: 79106161218.26.9381DDE Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id 12E99A0002 for ; Fri, 4 Feb 2022 19:59:08 +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=rCeZZFnhMgFeUZK5dhbFsBos7wHqny8hzB4SCwbybSo=; b=nuGaQO9JHx2CVzfQ1TI2nfi9Hz OTmxyNTT/O3OR66t73bZm4nNoBVQEpOWQcaUjR6WZZDlm9yiDLm4ogovQUVCPOCWBuAk/2OalnNcJ 7C1eiXNGx68vpIaSdoMQp/iCAjqamG0QCPCGncoCVgqtQsgsZYOp53AVVNtMaNYg5koJF0/0gE8hY C/OhXYlISSt0Tqmqa+J2DQHv9oSWIcs3PxSaqp/vIWI1lX8TisBFT4+hz4DE5UtLfOaskxc/b3Tvl EUckkV/Vd0Dyvos86okZ9o0EHRjJtiB/1OLsBoaKO6TYtbhAx2F4s3qgsNd5PIu5UwywA352/CGdv qNhudXaQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nG4jb-007Lr4-Mr; Fri, 04 Feb 2022 19:59:07 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org Subject: [PATCH 69/75] mm: Make large folios depend on THP Date: Fri, 4 Feb 2022 19:58:46 +0000 Message-Id: <20220204195852.1751729-70-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220204195852.1751729-1-willy@infradead.org> References: <20220204195852.1751729-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: nil X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 12E99A0002 X-Stat-Signature: wbnszpho3ao3h1md8xx8558esuw9june Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nuGaQO9J; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1644004748-676964 Content-Transfer-Encoding: quoted-printable 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: Some parts of the VM still depend on THP to handle large folios correctly. Until those are fixed, prevent creating large folios if THP are disabled. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 39115f75962c..ccf02a7d4d65 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -192,9 +192,14 @@ static inline void mapping_set_large_folios(struct a= ddress_space *mapping) __set_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags); } =20 +/* + * Large folio support currently depends on THP. These dependencies are + * being worked on but are not yet fixed. + */ static inline bool mapping_large_folio_support(struct address_space *map= ping) { - return test_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags); + return IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && + test_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags); } =20 static inline int filemap_nr_thps(struct address_space *mapping) --=20 2.34.1