lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMZfGtUL7_EfE4L-j0LxhqmpAX4ed94+1tuQYn6y4D1MBv0FDw@mail.gmail.com>
Date:   Fri, 22 Oct 2021 15:22:57 +0800
From:   Muchun Song <songmuchun@...edance.com>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Johannes Weiner <hannes@...xchg.org>,
        Michal Hocko <mhocko@...nel.org>,
        Vladimir Davydov <vdavydov.dev@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Roman Gushchin <guro@...com>, Arnd Bergmann <arnd@...db.de>,
        Shakeel Butt <shakeelb@...gle.com>,
        "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        Waiman Long <longman@...hat.com>,
        Cgroups <cgroups@...r.kernel.org>,
        Linux Memory Management List <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] memcg, kmem: mark cancel_charge() inline

On Fri, Oct 22, 2021 at 3:05 PM Arnd Bergmann <arnd@...nel.org> wrote:
>
> From: Arnd Bergmann <arnd@...db.de>
>
> 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 <arnd@...db.de>

Thanks. I guess this should be squashed into the commit 5f3345c17079
("memcg, kmem: further deprecate kmem.limit_in_bytes").

Reviewed-by: Muchun Song <songmuchun@...edance.com>

> ---
> 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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ