Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

memcg: rename mem_cgroup_ino() to mem_cgroup_id()

Rename mem_cgroup_ino() to mem_cgroup_id() and mem_cgroup_get_from_ino()
to mem_cgroup_get_from_id(). These functions now use cgroup IDs (from
cgroup_id()) rather than inode numbers, so the names should reflect that.

[shakeel.butt@linux.dev: replace ino with id, per SeongJae]
Link: https://lkml.kernel.org/r/flkqanhyettp5uq22bjwg37rtmnpeg3mghznsylxcxxgaafpl4@nov2x7tagma7
[akpm@linux-foundation.org: build fix]
Link: https://lkml.kernel.org/r/20251225232116.294540-9-shakeel.butt@linux.dev
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Wei Xu <weixugc@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Shakeel Butt and committed by
Andrew Morton
95296536 2202e3a8

+17 -17
+4 -4
include/linux/memcontrol.h
··· 830 830 } 831 831 struct mem_cgroup *mem_cgroup_from_private_id(unsigned short id); 832 832 833 - static inline u64 mem_cgroup_ino(struct mem_cgroup *memcg) 833 + static inline u64 mem_cgroup_id(struct mem_cgroup *memcg) 834 834 { 835 835 return memcg ? cgroup_id(memcg->css.cgroup) : 0; 836 836 } 837 837 838 - struct mem_cgroup *mem_cgroup_get_from_ino(u64 ino); 838 + struct mem_cgroup *mem_cgroup_get_from_id(u64 id); 839 839 840 840 static inline struct mem_cgroup *mem_cgroup_from_seq(struct seq_file *m) 841 841 { ··· 1288 1288 return NULL; 1289 1289 } 1290 1290 1291 - static inline u64 mem_cgroup_ino(struct mem_cgroup *memcg) 1291 + static inline u64 mem_cgroup_id(struct mem_cgroup *memcg) 1292 1292 { 1293 1293 return 0; 1294 1294 } 1295 1295 1296 - static inline struct mem_cgroup *mem_cgroup_get_from_ino(u64 ino) 1296 + static inline struct mem_cgroup *mem_cgroup_get_from_id(u64 id) 1297 1297 { 1298 1298 return NULL; 1299 1299 }
+1 -1
mm/damon/core.c
··· 2094 2094 unsigned long used_pages, numerator; 2095 2095 struct sysinfo i; 2096 2096 2097 - memcg = mem_cgroup_get_from_ino(goal->memcg_id); 2097 + memcg = mem_cgroup_get_from_id(goal->memcg_id); 2098 2098 if (!memcg) { 2099 2099 if (goal->metric == DAMOS_QUOTA_NODE_MEMCG_USED_BP) 2100 2100 return 0;
+1 -1
mm/damon/ops-common.c
··· 274 274 if (!memcg) 275 275 matched = false; 276 276 else 277 - matched = filter->memcg_id == mem_cgroup_ino(memcg); 277 + matched = filter->memcg_id == mem_cgroup_id(memcg); 278 278 rcu_read_unlock(); 279 279 break; 280 280 case DAMOS_FILTER_TYPE_YOUNG:
+1 -1
mm/damon/sysfs-schemes.c
··· 2513 2513 if (!mem_cgroup_online(memcg)) 2514 2514 continue; 2515 2515 if (damon_sysfs_memcg_path_eq(memcg, path, memcg_path)) { 2516 - *id = mem_cgroup_ino(memcg); 2516 + *id = mem_cgroup_id(memcg); 2517 2517 found = true; 2518 2518 break; 2519 2519 }
+2 -2
mm/memcontrol.c
··· 3615 3615 return xa_load(&mem_cgroup_private_ids, id); 3616 3616 } 3617 3617 3618 - struct mem_cgroup *mem_cgroup_get_from_ino(u64 ino) 3618 + struct mem_cgroup *mem_cgroup_get_from_id(u64 id) 3619 3619 { 3620 3620 struct cgroup *cgrp; 3621 3621 struct cgroup_subsys_state *css; 3622 3622 struct mem_cgroup *memcg = NULL; 3623 3623 3624 - cgrp = cgroup_get_from_id(ino); 3624 + cgrp = cgroup_get_from_id(id); 3625 3625 if (IS_ERR(cgrp)) 3626 3626 return NULL; 3627 3627
+5 -5
mm/shrinker_debug.c
··· 70 70 memcg_aware ? memcg : NULL, 71 71 count_per_node); 72 72 if (total) { 73 - seq_printf(m, "%llu", mem_cgroup_ino(memcg)); 73 + seq_printf(m, "%llu", mem_cgroup_id(memcg)); 74 74 for_each_node(nid) 75 75 seq_printf(m, " %lu", count_per_node[nid]); 76 76 seq_putc(m, '\n'); ··· 107 107 { 108 108 struct shrinker *shrinker = file->private_data; 109 109 unsigned long nr_to_scan = 0, read_len; 110 - u64 ino; 110 + u64 id; 111 111 struct shrink_control sc = { 112 112 .gfp_mask = GFP_KERNEL, 113 113 }; ··· 120 120 return -EFAULT; 121 121 kbuf[read_len] = '\0'; 122 122 123 - if (sscanf(kbuf, "%llu %d %lu", &ino, &nid, &nr_to_scan) != 3) 123 + if (sscanf(kbuf, "%llu %d %lu", &id, &nid, &nr_to_scan) != 3) 124 124 return -EINVAL; 125 125 126 126 if (nid < 0 || nid >= nr_node_ids) ··· 130 130 return size; 131 131 132 132 if (shrinker->flags & SHRINKER_MEMCG_AWARE) { 133 - memcg = mem_cgroup_get_from_ino(ino); 133 + memcg = mem_cgroup_get_from_id(id); 134 134 if (!memcg) 135 135 return -ENOENT; 136 136 ··· 138 138 mem_cgroup_put(memcg); 139 139 return -ENOENT; 140 140 } 141 - } else if (ino != 0) { 141 + } else if (id != 0) { 142 142 return -EINVAL; 143 143 } 144 144
+3 -3
mm/vmscan.c
··· 5416 5416 if (memcg) 5417 5417 cgroup_path(memcg->css.cgroup, m->private, PATH_MAX); 5418 5418 #endif 5419 - seq_printf(m, "memcg %llu %s\n", mem_cgroup_ino(memcg), path); 5419 + seq_printf(m, "memcg %llu %s\n", mem_cgroup_id(memcg), path); 5420 5420 } 5421 5421 5422 5422 seq_printf(m, " node %5d\n", nid); ··· 5512 5512 return -EINVAL; 5513 5513 5514 5514 if (!mem_cgroup_disabled()) { 5515 - memcg = mem_cgroup_get_from_ino(memcg_id); 5515 + memcg = mem_cgroup_get_from_id(memcg_id); 5516 5516 if (!memcg) 5517 5517 return -EINVAL; 5518 5518 } 5519 5519 5520 - if (memcg_id != mem_cgroup_ino(memcg)) 5520 + if (memcg_id != mem_cgroup_id(memcg)) 5521 5521 goto done; 5522 5522 5523 5523 sc->target_mem_cgroup = memcg;