From patchwork Sun Jan 16 12:18:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12714551 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 CB248C433F5 for ; Sun, 16 Jan 2022 12:38:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0C9A6B0073; Sun, 16 Jan 2022 07:38:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CBC0C6B0074; Sun, 16 Jan 2022 07:38:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAA7E6B0075; Sun, 16 Jan 2022 07:38:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0167.hostedemail.com [216.40.44.167]) by kanga.kvack.org (Postfix) with ESMTP id AC4026B0073 for ; Sun, 16 Jan 2022 07:38:07 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7358818210EB1 for ; Sun, 16 Jan 2022 12:38:07 +0000 (UTC) X-FDA: 79036102614.24.FDE2F9D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id 04DA080004 for ; Sun, 16 Jan 2022 12:38:06 +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=mH8MdEUBlsPhf7ilWJH9nUxsrJCyVKcinjFNzwz2y+c=; b=HADWwBMt7yDSfmBsMV6lI8Kdp9 gBuwraxP0C+hBTdLIjfFIK3OLLD/DrTdQ8u0qr2PVGguULrYpoZWChFHZKCPTRqeSOeEdo2ZHl78i ln6sfaOTz/vKTy4odQlD+D1Cv7jnk716fdVa/oVFspyPHrEZUNO3ZMBWUL1F/RF9wwVTg9BKnFAK6 s/InMwuxOMbmtWo7c74ctnEu829l5uNC4HvoAabVtrd7xNbHTUoluLkZ/QfP5aG9fzOMABVwmMvwq I9JTaoUNHsQlLKBZzf15ab5vTu533gYiccgQMgqx35DA/D7xeRk8YGksLRKrjlaZqz80HyXf8kURD jOZLZwtg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n94UM-007FUJ-FF; 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 05/12] mm: Fix READ_ONLY_THP warning Date: Sun, 16 Jan 2022 12:18:15 +0000 Message-Id: <20220116121822.1727633-6-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: 04DA080004 X-Stat-Signature: hwr8g459jqackdqraz8orc9pa6x8r1zb Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=HADWwBMt; 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: 1642336686-6370 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: These counters only exist if CONFIG_READ_ONLY_THP_FOR_FS is defined, but we do not need to warn if the filesystem natively supports large folios. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/pagemap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 270bf5136c34..877dabed0316 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -212,7 +212,7 @@ static inline void filemap_nr_thps_inc(struct address_space *mapping) if (!mapping_large_folio_support(mapping)) atomic_inc(&mapping->nr_thps); #else - WARN_ON_ONCE(1); + WARN_ON_ONCE(mapping_large_folio_support(mapping) == 0); #endif } @@ -222,7 +222,7 @@ static inline void filemap_nr_thps_dec(struct address_space *mapping) if (!mapping_large_folio_support(mapping)) atomic_dec(&mapping->nr_thps); #else - WARN_ON_ONCE(1); + WARN_ON_ONCE(mapping_large_folio_support(mapping) == 0); #endif }