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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC83BC433F5 for ; Fri, 22 Oct 2021 07:23:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3F58E610E7 for ; Fri, 22 Oct 2021 07:23:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3F58E610E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id B2BCF900003; Fri, 22 Oct 2021 03:23:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ADBA9900002; Fri, 22 Oct 2021 03:23:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9CB28900003; Fri, 22 Oct 2021 03:23:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0104.hostedemail.com [216.40.44.104]) by kanga.kvack.org (Postfix) with ESMTP id 8C971900002 for ; Fri, 22 Oct 2021 03:23:37 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 445E88249980 for ; Fri, 22 Oct 2021 07:23:37 +0000 (UTC) X-FDA: 78723233274.19.C6B741C Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) by imf28.hostedemail.com (Postfix) with ESMTP id 2417A90000A9 for ; Fri, 22 Oct 2021 07:23:36 +0000 (UTC) Received: by mail-yb1-f177.google.com with SMTP id i9so4858322ybi.8 for ; Fri, 22 Oct 2021 00:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I1vQaOge6Eq30iCGGtZzSSi/EQTEwgL0ohNIjHQi/KM=; b=uuv/tbejcRUmXHleRBldEGi/B8O1kL8uWt2IdylNW0f2jJK06tE3pdZp0cpmNvkwVC kqX0xP4gNIFA7x4hAdgmR5rmPmd7l4Cz3aR9LSqPxw5b4wZd3xJrhY8hjJLg5PIL60d6 VY/xp17n3XgfIHdpbNch2nQ0W4rS3KvDK+UJXhmTNg1ImhZOv1b4W36tyIkFYGIJb6qd MEYUD7/Nlmfc8ojqzQcELshvhKkOQz4qQCiQK3ozfd3XaMngCCAfbDC1dDyCUVoUKiWF 3+Y4SwVMNediRvwJD/8uzvVUFe9Mo8yON8fYU14LYUWogIr4xdYza8vMqTYn6+xBo4Ca Jmmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I1vQaOge6Eq30iCGGtZzSSi/EQTEwgL0ohNIjHQi/KM=; b=x9BF2ubTlR3e6dveDYLoBClNxrNljGKhlwJeVRf14liILacr7r0vkVNPIvOWc4BkYF O/5UP2nd497ovNdE8mZjB+/1cLqI3xLDAXHnTVZk2DPk4EA3UcPSK3Iz2Ko1npjaHbcz 7H1EAgSAHIAY5dDKkwNCAPKyN3hcqaCglgmbEqT+nUXsnvziw4rR24uOc3mLkg1h08ZQ ogFkg6hgZxVJO2aBMeLRHz/WITKnLcyji/UQhMhfF/XFqpRJGal/r8vGhkpMeJJYVaOH x5mGVk0NNSJ+xNDknMf8CDCckmp65Tq00h0IPN5AJNHrVY7rnVTsavLcF7lC18IHv+an Y/Ig== X-Gm-Message-State: AOAM532eRiKPrBecu9gp+CMG12Xm2bns+JPrq0XkqvMsjuSEfB+P6wN4 FadHeMsO4XAbx+jIAYp+Tip6uUKQgbt5hK/ttfUxUQ== X-Google-Smtp-Source: ABdhPJynaUJMm1pfY8vtl1azmPeIhZmAuFMCkwyfcLnEQitvb2qbakd1SlCiKsqH9PoA3mbuhs3+0Wm6ZuFdvQYfJ+k= X-Received: by 2002:a25:5443:: with SMTP id i64mr11067396ybb.125.1634887415224; Fri, 22 Oct 2021 00:23:35 -0700 (PDT) MIME-Version: 1.0 References: <20211022070542.679839-1-arnd@kernel.org> In-Reply-To: <20211022070542.679839-1-arnd@kernel.org> From: Muchun Song Date: Fri, 22 Oct 2021 15:22:57 +0800 Message-ID: Subject: Re: [PATCH] memcg, kmem: mark cancel_charge() inline To: Arnd Bergmann Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Stephen Rothwell , Roman Gushchin , Arnd Bergmann , Shakeel Butt , "Matthew Wilcox (Oracle)" , Waiman Long , Cgroups , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 2417A90000A9 X-Stat-Signature: fwddrrpbphgihmncb3uhm6n18ic5qnx5 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="uuv/tbej"; spf=pass (imf28.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.219.177 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1634887416-260005 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: On Fri, Oct 22, 2021 at 3:05 PM Arnd Bergmann wrote: > > 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 Thanks. I guess this should be squashed into the commit 5f3345c17079 ("memcg, kmem: further deprecate kmem.limit_in_bytes"). 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) > { > -- > 2.29.2 >