Skip to content

Commit a7cb874

Browse files
rgushchintorvalds
authored andcommitted
mm: memcg: fix obsolete code comments
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 9855609 ("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 0b8f73e ("mm: memcontrol: clean up alloc, online, offline, free functions") Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Roman Gushchin <[email protected]> Acked-by: Johannes Weiner <[email protected]> Reviewed-by: Shakeel Butt <[email protected]> Cc: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a5eb011 commit a7cb874

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

include/linux/memcontrol.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ struct mem_cgroup {
296296
int tcpmem_pressure;
297297

298298
#ifdef CONFIG_MEMCG_KMEM
299-
/* Index in the kmem_cache->memcg_params.memcg_caches array */
300299
int kmemcg_id;
301300
enum memcg_kmem_state kmem_state;
302301
struct obj_cgroup __rcu *objcg;
@@ -1562,9 +1561,8 @@ static inline void memcg_kmem_uncharge(struct mem_cgroup *memcg,
15621561
}
15631562

15641563
/*
1565-
* helper for accessing a memcg's index. It will be used as an index in the
1566-
* child cache array in kmem_cache, and also to derive its name. This function
1567-
* will return -1 when this is not a kmem-limited memcg.
1564+
* A helper for accessing memcg's kmem_id, used for getting
1565+
* corresponding LRU lists.
15681566
*/
15691567
static inline int memcg_cache_id(struct mem_cgroup *memcg)
15701568
{

mm/memcontrol.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3703,12 +3703,6 @@ static int memcg_online_kmem(struct mem_cgroup *memcg)
37033703

37043704
static_branch_enable(&memcg_kmem_enabled_key);
37053705

3706-
/*
3707-
* A memory cgroup is considered kmem-online as soon as it gets
3708-
* kmemcg_id. Setting the id after enabling static branching will
3709-
* guarantee no one starts accounting before all call sites are
3710-
* patched.
3711-
*/
37123706
memcg->kmemcg_id = memcg_id;
37133707
memcg->kmem_state = KMEM_ONLINE;
37143708

0 commit comments

Comments
 (0)