Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp50538pxv; Wed, 14 Jul 2021 22:38:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0ictiHMiU8valT5TDN7FkWJ3MZWPklpfnWDqohjdVNQunQXy+Zo5VOvdboj+Ass/2PD6g X-Received: by 2002:a05:6402:28a1:: with SMTP id eg33mr4009271edb.249.1626327497495; Wed, 14 Jul 2021 22:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626327497; cv=none; d=google.com; s=arc-20160816; b=FM78TTdHN/vW0oltnRjrfDdAn7u925P23xr4VCd+ZXf8UEVFlUazpBQbKSrLHDJIJE svG4BL+qx/xMp2V85d79t2YrnHIV95BR8ufi5fTLunZhu1IiZSqo+0wzfXDCTl8WEk6F ONkfKNn358UvkARISFiJxv6EvCB1RF4d+mCLw0Gnf/SDZhFe8JWHWc5QfQNMS/S34z79 n9FyiJTomAaP+Ee/AQUmkB349C3xULPR+AFH0dx02Pjjzl+TbBwnJ4hgccfRxAFSs0mc erCklyOwb+DBknD3U4VQMwIpLTape/NuG7wRmKOhItU1dsl2aBQwwnYF7pKqaxrOAPmP Or0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0j89Y9aRfbS0Rk8ILDg18YHesTGwlxkjEArXWx9pLdg=; b=IdfWkHD+YwGINc0kNZanOr4yIqSJNucoJgnD+rDAjiVYDZa7cpE7PgoucZPVJE7UAe RXTvAgeqPuhbLbwO3A8XCbBPRpV4BSY5VWqtWaAY3WfXhBFa5DMyHjVVd+HS0lkY5wYV ylbQnOl8ed2y1ygrXk36kBnRf77Bpsxz+dl/lIihNTf4x42FIIoBmap2wS6v0rMCkko4 yICI+sSbFOrCXtWVDWjtYXZ+NnOY2iIsumx7jQf0KzOQQ65GYm3K7tWaZ3ls5cNwHZBa gvafPwzqjBkCU9r3LP7IqqU0X2DGdqvkKmIbGVdjnRwBUqnM1eHDCLcJ4F6C4g5OWC6o 888w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=rtZ8plYf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp16si7261179ejc.164.2021.07.14.22.37.53; Wed, 14 Jul 2021 22:38:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=rtZ8plYf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239135AbhGOF3C (ORCPT + 99 others); Thu, 15 Jul 2021 01:29:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbhGOF26 (ORCPT ); Thu, 15 Jul 2021 01:28:58 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 131B7C06175F; Wed, 14 Jul 2021 22:26:06 -0700 (PDT) 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=0j89Y9aRfbS0Rk8ILDg18YHesTGwlxkjEArXWx9pLdg=; b=rtZ8plYfg2O2vQnMqCcN8Ix1eV 0XJ3QSThuBsUacVKOjdcIEAp2lxqyCZfpWvfL3hS76LBjhmK4tzKQWTC+ibKYHQbVguyCr3NUCT/l PfiDy86CIphQ+viU7oNBndb1wti75NmlHC6gxm1d+t1Cee2mwhtd/5LFKF1TA7HA4/TBS5bfjsZBK B9GlLpfAAYV2XjdDz31IcMs6Ff/yg+qAPAiXiogB7y4H3S19Ap1QH+jLHS2AQiTBQ2T0KDtCjUZwJ ns8WUYvvrwBXkKxngBqKxGgMunIOwXrWcWD/izHm4xbuTwdbZ78ZPrjccbmsd4s/WgKzPl7y51run ct8aCKMw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3tqn-00312o-KS; Thu, 15 Jul 2021 05:24:07 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v14 133/138] mm: Fix READ_ONLY_THP warning Date: Thu, 15 Jul 2021 04:36:59 +0100 Message-Id: <20210715033704.692967-134-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715033704.692967-1-willy@infradead.org> References: <20210715033704.692967-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These counters only exist if CONFIG_READ_ONLY_THP_FOR_FS is defined, but we should not warn if the filesystem natively supports THPs. 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 25b1bf3b1cdb..81cccb708df7 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -146,7 +146,7 @@ static inline void filemap_nr_thps_inc(struct address_space *mapping) if (!mapping_thp_support(mapping)) atomic_inc(&mapping->nr_thps); #else - WARN_ON_ONCE(1); + WARN_ON_ONCE(!mapping_thp_support(mapping)); #endif } @@ -156,7 +156,7 @@ static inline void filemap_nr_thps_dec(struct address_space *mapping) if (!mapping_thp_support(mapping)) atomic_dec(&mapping->nr_thps); #else - WARN_ON_ONCE(1); + WARN_ON_ONCE(!mapping_thp_support(mapping)); #endif } -- 2.30.2