lkml.org 
[lkml]   [2023]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: memcontrol: rename memcg_kmem_enabled()
On Mon 13-02-23 11:29:22, Roman Gushchin wrote:
> Currently there are two kmem-related helper functions with a confusing
> semantics: memcg_kmem_enabled() and mem_cgroup_kmem_disabled().
>
> The problem is that an obvious expectation
> memcg_kmem_enabled() == !mem_cgroup_kmem_disabled(),
> can be false.
>
> mem_cgroup_kmem_disabled() is similar to mem_cgroup_disabled(): it
> returns true only if CONFIG_MEMCG_KMEM is not set or the kmem
> accounting is disabled using a boot time kernel option
> "cgroup.memory=nokmem". It never changes the value dynamically.
>
> memcg_kmem_enabled() is different: it always returns false until
> the first non-root memory cgroup will get online (assuming the kernel
> memory accounting is enabled). It's goal is to improve the performance
> on systems without the cgroupfs mounted/memory controller enabled or
> on the systems with only the root memory cgroup.
>
> To make things more obvious and avoid potential bugs, let's rename
> memcg_kmem_enabled() to memcg_kmem_online().
>
> Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Michal Hocko <mhocko@kernel.org>
> Cc: Shakeel Butt <shakeelb@google.com>
> Cc: Muchun Song <muchun.song@linux.dev>
> Cc: Dennis Zhou <dennis@kernel.org>
> Cc: linux-mm@kvack.org

Makes sense
Acked-by: Michal Hocko <mhocko@suse.com>
Thanks!

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2023-03-27 00:21    [W:0.087 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site