linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: memcg: fix obsolete code comments
@ 2020-11-10 18:46 Roman Gushchin
  2020-11-10 18:48 ` Johannes Weiner
  2020-11-10 19:01 ` Shakeel Butt
  0 siblings, 2 replies; 3+ messages in thread
From: Roman Gushchin @ 2020-11-10 18:46 UTC (permalink / raw)
  To: Andrew Morton, linux-mm
  Cc: Shakeel Butt, Johannes Weiner, Michal Hocko, linux-kernel,
	kernel-team, Roman Gushchin

This patch fixes/removes some obsolete comments in the code related
to the kernel memory accounting:
- kmem_cache->memcg_params.memcg_caches has been removed
  by commit 9855609bde03 ("mm: memcg/slab: use a single set of
  kmem_caches for all accounted allocations")
- memcg->kmemcg_id is not used as a gate for kmem accounting since
  commit 0b8f73e10428 ("mm: memcontrol: clean up alloc, online,
  offline, free functions")

Signed-off-by: Roman Gushchin <guro@fb.com>
---
 include/linux/memcontrol.h | 6 ++----
 mm/memcontrol.c            | 6 ------
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 20108e426f84..01099dfa839c 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -310,7 +310,6 @@ struct mem_cgroup {
 	int			tcpmem_pressure;
 
 #ifdef CONFIG_MEMCG_KMEM
-        /* Index in the kmem_cache->memcg_params.memcg_caches array */
 	int kmemcg_id;
 	enum memcg_kmem_state kmem_state;
 	struct obj_cgroup __rcu *objcg;
@@ -1641,9 +1640,8 @@ static inline void memcg_kmem_uncharge_page(struct page *page, int order)
 }
 
 /*
- * helper for accessing a memcg's index. It will be used as an index in the
- * child cache array in kmem_cache, and also to derive its name. This function
- * will return -1 when this is not a kmem-limited memcg.
+ * A helper for accessing memcg's kmem_id, used for getting
+ * corresponding LRU lists.
  */
 static inline int memcg_cache_id(struct mem_cgroup *memcg)
 {
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 69a2893a6455..62bbd48d8445 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3680,12 +3680,6 @@ static int memcg_online_kmem(struct mem_cgroup *memcg)
 
 	static_branch_enable(&memcg_kmem_enabled_key);
 
-	/*
-	 * A memory cgroup is considered kmem-online as soon as it gets
-	 * kmemcg_id. Setting the id after enabling static branching will
-	 * guarantee no one starts accounting before all call sites are
-	 * patched.
-	 */
 	memcg->kmemcg_id = memcg_id;
 	memcg->kmem_state = KMEM_ONLINE;
 
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: memcg: fix obsolete code comments
  2020-11-10 18:46 [PATCH] mm: memcg: fix obsolete code comments Roman Gushchin
@ 2020-11-10 18:48 ` Johannes Weiner
  2020-11-10 19:01 ` Shakeel Butt
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Weiner @ 2020-11-10 18:48 UTC (permalink / raw)
  To: Roman Gushchin
  Cc: Andrew Morton, linux-mm, Shakeel Butt, Michal Hocko,
	linux-kernel, kernel-team

On Tue, Nov 10, 2020 at 10:46:15AM -0800, Roman Gushchin wrote:
> This patch fixes/removes some obsolete comments in the code related
> to the kernel memory accounting:
> - kmem_cache->memcg_params.memcg_caches has been removed
>   by commit 9855609bde03 ("mm: memcg/slab: use a single set of
>   kmem_caches for all accounted allocations")
> - memcg->kmemcg_id is not used as a gate for kmem accounting since
>   commit 0b8f73e10428 ("mm: memcontrol: clean up alloc, online,
>   offline, free functions")
> 
> Signed-off-by: Roman Gushchin <guro@fb.com>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

Thanks Roman


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: memcg: fix obsolete code comments
  2020-11-10 18:46 [PATCH] mm: memcg: fix obsolete code comments Roman Gushchin
  2020-11-10 18:48 ` Johannes Weiner
@ 2020-11-10 19:01 ` Shakeel Butt
  1 sibling, 0 replies; 3+ messages in thread
From: Shakeel Butt @ 2020-11-10 19:01 UTC (permalink / raw)
  To: Roman Gushchin
  Cc: Andrew Morton, Linux MM, Johannes Weiner, Michal Hocko, LKML,
	Kernel Team

On Tue, Nov 10, 2020 at 10:46 AM Roman Gushchin <guro@fb.com> wrote:
>
> This patch fixes/removes some obsolete comments in the code related
> to the kernel memory accounting:
> - kmem_cache->memcg_params.memcg_caches has been removed
>   by commit 9855609bde03 ("mm: memcg/slab: use a single set of
>   kmem_caches for all accounted allocations")
> - memcg->kmemcg_id is not used as a gate for kmem accounting since
>   commit 0b8f73e10428 ("mm: memcontrol: clean up alloc, online,
>   offline, free functions")
>
> Signed-off-by: Roman Gushchin <guro@fb.com>

Reviewed-by: Shakeel Butt <shakeelb@google.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-10 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-10 18:46 [PATCH] mm: memcg: fix obsolete code comments Roman Gushchin
2020-11-10 18:48 ` Johannes Weiner
2020-11-10 19:01 ` Shakeel Butt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).