From patchwork Sun Jan 16 12:18:17 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: 12714548 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 B2914C433EF for ; Sun, 16 Jan 2022 12:18:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 248626B0074; Sun, 16 Jan 2022 07:18:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DBC626B0078; Sun, 16 Jan 2022 07:18:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AFC8E6B0074; Sun, 16 Jan 2022 07:18:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0096.hostedemail.com [216.40.44.96]) by kanga.kvack.org (Postfix) with ESMTP id 5218A6B0080 for ; Sun, 16 Jan 2022 07:18:29 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id ED32596F2E for ; Sun, 16 Jan 2022 12:18:28 +0000 (UTC) X-FDA: 79036053096.26.D814728 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf13.hostedemail.com (Postfix) with ESMTP id 0D72620003 for ; Sun, 16 Jan 2022 12:18:27 +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=x22IDWNKLOZQBYNT5ZnUP/ws3USwr++SKpDySW8y9SA=; b=HyvtLeCzLmcJvJgRUexW0kzX6z +CRkAaXfZ/sTESZXnMn5cpVO7vkJEmjCnKIAk9RLbndO0OCnmumRMxPCQOkB1h+hACL+eHJGozBpV YR5aEcdeM3fb+OMfI6dAAXefLBP+ZijUN+2RDaQodeu2/GSvNBpUFyE/8wVkcRrCN3spFVOwfaE5H FhgDkdNCnn4Gn5WzHWwSWrKrPM9IeQIENcEda5qztngwQTt9WBudC3M9mKx+/ZxC50QDup2/c+SXQ IODSc9BcXn9j2IDVgDVnrKAQqCPWOnMAufdlvb149RlGDdTxN2yB9IlfjR+VSYfduJaiteCUzzcM/ ZMKSG3cA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n94UM-007FUS-LE; 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: "Matthew Wilcox (Oracle)" Subject: [PATCH 07/12] mm: Make large folios depend on THP Date: Sun, 16 Jan 2022 12:18:17 +0000 Message-Id: <20220116121822.1727633-8-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: 0D72620003 X-Stat-Signature: no4idxxmhy8rk8tj1ofe6ytdxn9tz891 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=HyvtLeCz; dmarc=none; spf=none (imf13.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: rspam02 X-HE-Tag: 1642335507-614248 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 877dabed0316..3e348e0a9e4e 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -192,9 +192,14 @@ static inline void mapping_set_large_folios(struct address_space *mapping) __set_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags); } +/* + * 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 *mapping) { - return test_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags); + return IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && + test_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags); } static inline int filemap_nr_thps(struct address_space *mapping)