From patchwork Fri Oct 22 07:05:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 12577203 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 492EEC433EF for ; Fri, 22 Oct 2021 07:05:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B9C7A61075 for ; Fri, 22 Oct 2021 07:05:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B9C7A61075 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id EEDC2900003; Fri, 22 Oct 2021 03:05:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E9CD4900002; Fri, 22 Oct 2021 03:05:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D8CA0900003; Fri, 22 Oct 2021 03:05:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0233.hostedemail.com [216.40.44.233]) by kanga.kvack.org (Postfix) with ESMTP id CA408900002 for ; Fri, 22 Oct 2021 03:05:49 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 74C3C30C85 for ; Fri, 22 Oct 2021 07:05:49 +0000 (UTC) X-FDA: 78723188418.10.108E413 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf08.hostedemail.com (Postfix) with ESMTP id 6A6F430000AA for ; Fri, 22 Oct 2021 07:05:44 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id A09D560ED3; Fri, 22 Oct 2021 07:05:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634886348; bh=iLRhWGhOtATtNXfjLsY/C/FzcVIkkj6omLPayvSrHVc=; h=From:To:Cc:Subject:Date:From; b=WvBpQzKjqVFToSn3i2NADviklR3XuCrbfuC3GBfqsU7+otQA2XAlMiiV1wNk7LED6 T0Vu2AL+7me+PouplKBEcm7CD5tf8wQJ91BYw5i+tcyIBxIRl9I5A8bCQAaM8/ukdf 4hOSK/JiM35OiNJP6W9PhHmDIRrotBP57yFezB7OjY3U+DWO7nKc7Xcqz9Vm/ELfDR BRfJczzddWZwsF620p9imsVc5UiigA2Rxk4jplLQL11LFAdYJ962ELZRsVcVMgEoLX Y+9K0EkVREF4npPNMmr3rcKTSeiwG/XEXNxmlxkFz2ILlfy336WBO7XpAU8+6EUP5w NB8i6vWNlwLZA== From: Arnd Bergmann To: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Stephen Rothwell , Muchun Song , Roman Gushchin Cc: Arnd Bergmann , Shakeel Butt , "Matthew Wilcox (Oracle)" , Waiman Long , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] memcg, kmem: mark cancel_charge() inline Date: Fri, 22 Oct 2021 09:05:35 +0200 Message-Id: <20211022070542.679839-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6A6F430000AA X-Stat-Signature: p7r58bhy3knobw1hoa9xt16u9mp14nyb Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=WvBpQzKj; spf=pass (imf08.hostedemail.com: domain of arnd@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=arnd@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1634886344-702119 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: Arnd Bergmann cancel_charge() is no longer called for CONFIG_MEMCG_KMEM on NOMMU targets, which causes a compiletime warning: mm/memcontrol.c:2774:13: error: unused function 'cancel_charge' [-Werror,-Wunused-function] Remove the now-incorrect #ifdef and just mark the function 'inline' like the other related helpers. This is simpler and means we no longer have to match the #ifdef with the caller. Fixes: 5f3345c17079 ("memcg, kmem: further deprecate kmem.limit_in_bytes") Signed-off-by: Arnd Bergmann Reviewed-by: Muchun Song --- The 5f3345c17079 commit is in -mm, so the commit ID is not stable. Feel free to just fold this into the other patch, or take out that reference --- mm/memcontrol.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6538595994d2..9edccfeac804 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2770,8 +2770,7 @@ static inline int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, return try_charge_memcg(memcg, gfp_mask, nr_pages); } -#if defined(CONFIG_MEMCG_KMEM) || defined(CONFIG_MMU) -static void cancel_charge(struct mem_cgroup *memcg, unsigned int nr_pages) +static inline void cancel_charge(struct mem_cgroup *memcg, unsigned int nr_pages) { if (mem_cgroup_is_root(memcg)) return; @@ -2780,7 +2779,6 @@ static void cancel_charge(struct mem_cgroup *memcg, unsigned int nr_pages) if (do_memsw_account()) page_counter_uncharge(&memcg->memsw, nr_pages); } -#endif static void commit_charge(struct folio *folio, struct mem_cgroup *memcg) {