| /linux/mm/ |
| H A D | memcontrol-v1.h | 25 struct mem_cgroup *mem_cgroup_private_id_get_online(struct mem_cgroup *memcg, 37 unsigned long memcg_events_local(struct mem_cgroup *memcg, int event); 38 unsigned long memcg_page_state_local(struct mem_cgroup *memcg, int idx); 39 unsigned long memcg_page_state_local_output(struct mem_cgroup *memcg, int item); 40 bool memcg1_alloc_events(struct mem_cgroup *memcg); 41 void memcg1_free_events(struct mem_cgroup *memcg); 43 void memcg1_memcg_init(struct mem_cgroup *memcg); 44 void memcg1_remove_from_trees(struct mem_cgroup *memcg); 46 static inline void memcg1_soft_limit_reset(struct mem_cgroup *memcg) in memcg1_soft_limit_reset() argument 48 WRITE_ONCE(memcg->soft_limit, PAGE_COUNTER_MAX); in memcg1_soft_limit_reset() [all …]
|
| H A D | memcontrol.c | 116 struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg) in memcg_to_vmpressure() argument 118 if (!memcg) in memcg_to_vmpressure() 119 memcg = root_mem_cgroup; in memcg_to_vmpressure() 120 return &memcg->vmpressure; in memcg_to_vmpressure() 139 static void memcg_uncharge(struct mem_cgroup *memcg, unsigned int nr_pages); 141 static void memcg_uncharge_kmem(struct mem_cgroup *memcg, unsigned int nr_pages) in memcg_uncharge_kmem() argument 143 mod_memcg_state(memcg, MEMCG_KMEM, -nr_pages); in memcg_uncharge_kmem() 144 memcg1_account_kmem(memcg, -nr_pages); in memcg_uncharge_kmem() 145 if (!mem_cgroup_is_root(memcg)) in memcg_uncharge_kmem() 146 memcg_uncharge(memcg, nr_pages); in memcg_uncharge_kmem() [all …]
|
| H A D | memcontrol-v1.c | 57 struct mem_cgroup *memcg; member 71 int (*register_event)(struct mem_cgroup *memcg, 78 void (*unregister_event)(struct mem_cgroup *memcg, 167 static unsigned long soft_limit_excess(struct mem_cgroup *memcg) in soft_limit_excess() argument 169 unsigned long nr_pages = page_counter_read(&memcg->memory); in soft_limit_excess() 170 unsigned long soft_limit = READ_ONCE(memcg->soft_limit); in soft_limit_excess() 179 static void memcg1_update_tree(struct mem_cgroup *memcg, int nid) in memcg1_update_tree() argument 186 if (soft_limit_excess(memcg)) in memcg1_update_tree() 187 lru_gen_soft_reclaim(memcg, nid); in memcg1_update_tree() 198 for (; memcg; memcg = parent_mem_cgroup(memcg)) { in memcg1_update_tree() [all …]
|
| H A D | shrinker.c | 62 static void __free_shrinker_info(struct mem_cgroup *memcg) in __free_shrinker_info() argument 71 pn = memcg->nodeinfo[nid]; in __free_shrinker_info() 79 void free_shrinker_info(struct mem_cgroup *memcg) in free_shrinker_info() argument 82 __free_shrinker_info(memcg); in free_shrinker_info() 86 int alloc_shrinker_info(struct mem_cgroup *memcg) in alloc_shrinker_info() argument 103 rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info); in alloc_shrinker_info() 110 __free_shrinker_info(memcg); in alloc_shrinker_info() 115 static struct shrinker_info *shrinker_info_protected(struct mem_cgroup *memcg, in shrinker_info_protected() argument 118 return rcu_dereference_protected(memcg->nodeinfo[nid]->shrinker_info, in shrinker_info_protected() 122 static int expand_one_shrinker_info(struct mem_cgroup *memcg, int new_size, in expand_one_shrinker_info() argument [all …]
|
| H A D | shrinker_debug.c | 19 struct mem_cgroup *memcg, in shrinker_count_objects() argument 30 .memcg = memcg, in shrinker_count_objects() 51 struct mem_cgroup *memcg; in shrinker_debugfs_count_show() local 62 memcg = mem_cgroup_iter(NULL, NULL, NULL); in shrinker_debugfs_count_show() 64 if (memcg && !mem_cgroup_online(memcg)) in shrinker_debugfs_count_show() 68 memcg_aware ? memcg : NULL, in shrinker_debugfs_count_show() 71 seq_printf(m, "%llu", mem_cgroup_id(memcg)); in shrinker_debugfs_count_show() 78 mem_cgroup_iter_break(NULL, memcg); in shrinker_debugfs_count_show() 83 mem_cgroup_iter_break(NULL, memcg); in shrinker_debugfs_count_show() 87 } while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL); in shrinker_debugfs_count_show() [all …]
|
| H A D | vmscan.c | 203 static int sc_swappiness(struct scan_control *sc, struct mem_cgroup *memcg) in sc_swappiness() argument 207 return mem_cgroup_swappiness(memcg); in sc_swappiness() 326 struct mem_cgroup *memcg) in can_demote() argument 341 mem_cgroup_node_filter_allowed(memcg, &allowed_mask); in can_demote() 345 static inline bool can_reclaim_anon_pages(struct mem_cgroup *memcg, in can_reclaim_anon_pages() argument 349 if (memcg == NULL) { in can_reclaim_anon_pages() 358 if (mem_cgroup_get_nr_swap_pages(memcg) > 0) in can_reclaim_anon_pages() 367 return can_demote(nid, sc, memcg); in can_reclaim_anon_pages() 412 struct mem_cgroup *memcg = NULL; in drop_slab_node() local 414 memcg = mem_cgroup_iter(NULL, NULL, NULL); in drop_slab_node() [all …]
|
| H A D | zswap.c | 671 struct mem_cgroup *memcg; in zswap_lru_add() local 685 memcg = mem_cgroup_from_entry(entry); in zswap_lru_add() 687 list_lru_add(&zswap_list_lru, &entry->lru, nid, memcg); in zswap_lru_add() 694 struct mem_cgroup *memcg; in zswap_lru_del() local 697 memcg = mem_cgroup_from_entry(entry); in zswap_lru_del() 699 list_lru_del(&zswap_list_lru, &entry->lru, nid, memcg); in zswap_lru_del() 730 void zswap_memcg_offline_cleanup(struct mem_cgroup *memcg) in zswap_memcg_offline_cleanup() argument 734 if (zswap_next_shrink == memcg) { in zswap_memcg_offline_cleanup() 1178 !mem_cgroup_zswap_writeback_enabled(sc->memcg)) { in zswap_shrinker_scan() 1195 struct mem_cgroup *memcg = sc->memcg; in zswap_shrinker_count() local [all …]
|
| H A D | workingset.c | 247 struct mem_cgroup *memcg; in lru_gen_eviction() local 255 memcg = folio_memcg(folio); in lru_gen_eviction() 256 lruvec = mem_cgroup_lruvec(memcg, pgdat); in lru_gen_eviction() 263 memcg_id = mem_cgroup_private_id(memcg); in lru_gen_eviction() 278 struct mem_cgroup *memcg; in lru_gen_test_recent() local 283 memcg = mem_cgroup_from_private_id(memcg_id); in lru_gen_test_recent() 284 *lruvec = mem_cgroup_lruvec(memcg, pgdat); in lru_gen_test_recent() 551 struct mem_cgroup *memcg; in workingset_refault() local 573 memcg = get_mem_cgroup_from_folio(folio); in workingset_refault() 574 lruvec = mem_cgroup_lruvec(memcg, folio_pgdat(folio)); in workingset_refault() [all …]
|
| H A D | swap.h | 85 static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) in mem_cgroup_swappiness() argument 89 !mem_cgroup_disabled() && !mem_cgroup_is_root(memcg)) in mem_cgroup_swappiness() 90 return READ_ONCE(memcg->swappiness); in mem_cgroup_swappiness()
|
| /linux/include/linux/ |
| H A D | memcontrol.h | 91 struct mem_cgroup *memcg; /* Back pointer, we cannot */ member 187 struct mem_cgroup *memcg; member 383 return READ_ONCE(objcg->memcg); in obj_cgroup_memcg() 491 struct mem_cgroup *memcg; in get_mem_cgroup_from_objcg() local 495 memcg = obj_cgroup_memcg(objcg); in get_mem_cgroup_from_objcg() 496 if (unlikely(!css_tryget(&memcg->css))) in get_mem_cgroup_from_objcg() 500 return memcg; in get_mem_cgroup_from_objcg() 523 static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg) in mem_cgroup_is_root() argument 525 return (memcg == root_mem_cgroup); in mem_cgroup_is_root() 541 return !sc->memcg || mem_cgroup_is_root(sc->memcg); in mem_cgroup_shrink_is_root() [all …]
|
| H A D | mmzone.h | 694 void lru_gen_init_memcg(struct mem_cgroup *memcg); 695 void lru_gen_exit_memcg(struct mem_cgroup *memcg); 696 void lru_gen_online_memcg(struct mem_cgroup *memcg); 697 void lru_gen_offline_memcg(struct mem_cgroup *memcg); 698 void lru_gen_release_memcg(struct mem_cgroup *memcg); 699 void lru_gen_soft_reclaim(struct mem_cgroup *memcg, int nid); 700 void max_lru_gen_memcg(struct mem_cgroup *memcg, int nid); 701 bool recheck_lru_gen_max_memcg(struct mem_cgroup *memcg, int nid); 702 void lru_gen_reparent_memcg(struct mem_cgroup *memcg, struct mem_cgroup *parent, int nid); 720 static inline void lru_gen_init_memcg(struct mem_cgroup *memcg) in lru_gen_init_memcg() argument [all …]
|
| H A D | swap.h | 477 void lru_reparent_memcg(struct mem_cgroup *memcg, struct mem_cgroup *parent, int nid); 511 extern long mem_cgroup_get_nr_swap_pages(struct mem_cgroup *memcg); 524 static inline long mem_cgroup_get_nr_swap_pages(struct mem_cgroup *memcg) in mem_cgroup_get_nr_swap_pages() argument
|
| H A D | shrinker.h | 55 struct mem_cgroup *memcg; member
|
| /linux/tools/testing/selftests/cgroup/ |
| H A D | test_memcontrol.c | 263 char *memcg; in test_memcg_current_peak() local 268 memcg = cg_name(root, "memcg_test"); in test_memcg_current_peak() 269 if (!memcg) in test_memcg_current_peak() 272 if (cg_create(memcg)) in test_memcg_current_peak() 275 current = cg_read_long(memcg, "memory.current"); in test_memcg_current_peak() 279 peak = cg_read_long(memcg, "memory.peak"); in test_memcg_current_peak() 283 if (cg_run(memcg, alloc_anon_50M_check, NULL)) in test_memcg_current_peak() 286 peak = cg_read_long(memcg, "memory.peak"); in test_memcg_current_peak() 295 peak_fd = cg_open(memcg, "memory.peak", O_RDWR | O_APPEND | O_CLOEXEC); in test_memcg_current_peak() 316 peak_fd2 = cg_open(memcg, "memory.peak", O_RDWR | O_APPEND | O_CLOEXEC); in test_memcg_current_peak() [all …]
|
| H A D | memcg_protection.m | 5 % This script simulates reclaim protection behavior on a single level of memcg 65 % commit 1bc63fb1272b ("mm, memcg: make scan aggression always exclude protection")
|
| /linux/mm/damon/ |
| H A D | sysfs-common.c | 106 static bool damon_sysfs_memcg_path_eq(struct mem_cgroup *memcg, in damon_sysfs_memcg_path_eq() argument 110 cgroup_path(memcg->css.cgroup, memcg_path_buf, PATH_MAX); in damon_sysfs_memcg_path_eq() 119 struct mem_cgroup *memcg; in damon_sysfs_memcg_path_to_id() local 130 for (memcg = mem_cgroup_iter(NULL, NULL, NULL); memcg; in damon_sysfs_memcg_path_to_id() 131 memcg = mem_cgroup_iter(NULL, memcg, NULL)) { in damon_sysfs_memcg_path_to_id() 133 if (!mem_cgroup_online(memcg)) in damon_sysfs_memcg_path_to_id() 135 if (damon_sysfs_memcg_path_eq(memcg, path, memcg_path)) { in damon_sysfs_memcg_path_to_id() 136 *id = mem_cgroup_id(memcg); in damon_sysfs_memcg_path_to_id() 138 mem_cgroup_iter_break(NULL, memcg); in damon_sysfs_memcg_path_to_id()
|
| H A D | ops-common.c | 269 struct mem_cgroup *memcg; in damos_folio_filter_match() local 281 memcg = folio_memcg_check(folio); in damos_folio_filter_match() 282 if (!memcg) in damos_folio_filter_match() 285 matched = filter->memcg_id == mem_cgroup_id(memcg); in damos_folio_filter_match()
|
| /linux/tools/cgroup/ |
| H A D | memcg_slabinfo.py | 42 memcg = container_of(css, 'struct mem_cgroup', 'css') 43 MEMCGS[css.cgroup.kn.id.value_()] = memcg 170 memcg = MEMCGS[cgroup_id] 186 obj_cgroups.add(memcg.objcg.value_()) 188 memcg.objcg_list.address_of_(), 220 memcg.kmem_caches.address_of_(),
|
| /linux/Documentation/admin-guide/cgroup-v1/ |
| H A D | memcg_test.rst | 9 Because VM is getting complex (one of reasons is memcg...), memcg's behavior 10 is complex. This is a document for memcg's internal behavior. 61 At commit(), the page is associated with the memcg. 112 But brief explanation of the behavior of memcg around shmem will be 134 Each memcg has its own vector of LRUs (inactive anon, active anon, 136 each LRU handled under a single lru_lock for that memcg and node. 143 9.1 Small limit to memcg. 146 When you do test to do racy case, it's good test to set memcg's limit 156 Historically, memcg's shmem handling was poor and we saw some amount 246 Besides management of swap is one of complicated parts of memcg, [all …]
|
| H A D | memory.rst | 19 see patch's title and function names tend to use "memcg". 47 - pages are linked to per-memcg LRU exclusively, and there is no global LRU. 91 Per memcg knob does not exist in cgroup v2. 226 Since page's memcg recorded into swap whatever memsw enabled, the page will 352 from inside the memcg. The creation is done lazily, so some objects can still be 354 belong to the same memcg. This only fails to hold when a task is migrated to a 355 different memcg during the page allocation by the cache. 374 This is the standard memcg limitation mechanism already present before kmem 533 Though rmdir() offlines memcg, but the memcg may still stay there due to 623 there is a swap storage available. This might lead to memcg OOM killer [all …]
|
| /linux/Documentation/translations/zh_CN/mm/ |
| H A D | hwpoison.rst | 119 corrupt-filter-memcg 120 限制注入到memgroup拥有的页面。由memcg的inode号指定。 130 echo $memcg_ino > /debug/hwpoison/corrupt-filter-memcg
|
| H A D | vmalloced-kernel-stacks.rst | 87 进行memcg核算。因此,__vmalloc_node_range被调用时没有__GFP_ACCOUNT。
|
| /linux/Documentation/admin-guide/mm/ |
| H A D | shrinker_debugfs.rst | 14 trigger *count_objects()* and *scan_objects()* callbacks for each memcg and 59 If the shrinker is not memcg-aware or CONFIG_MEMCG is off, 0 is printed 112 For a non-memcg-aware shrinker or on a system with no memory
|
| /linux/Documentation/mm/ |
| H A D | multigen_lru.rst | 162 An ``mm_struct`` list is maintained for each memcg, and an 163 ``mm_struct`` follows its owner task to the new memcg when this task 173 ``mm_struct`` was migrated, pages left in the previous memcg will be 174 ignored when the current memcg is under reclaim. Similarly, page table 225 An memcg LRU is a per-node LRU of memcgs. It is also an LRU of LRUs, 226 since each node and memcg combination has an LRU of folios (see 229 data centers. Note that memcg LRU only applies to global reclaim. 231 The basic structure of an memcg LRU can be understood by an analogy to 238 3. Other events trigger similar operations, e.g., offlining an memcg 243 1. Sharding, which allows each thread to start at a random memcg (in
|
| /linux/kernel/bpf/ |
| H A D | memalloc.c | 215 struct mem_cgroup *memcg = NULL, *old_memcg; in alloc_bulk() 245 memcg = get_memcg(c); in alloc_bulk() 246 old_memcg = set_active_memcg(memcg); in alloc_bulk() 259 mem_cgroup_put(memcg); in free_one() 1031 struct mem_cgroup *memcg, *old_memcg; in bpf_mem_alloc_set_dtor() 1033 memcg = get_memcg(c); in bpf_mem_alloc_set_dtor() 1034 old_memcg = set_active_memcg(memcg); in bpf_mem_alloc_set_dtor() 1039 mem_cgroup_put(memcg); in bpf_mem_alloc_set_dtor() 210 struct mem_cgroup *memcg = NULL, *old_memcg; alloc_bulk() local 994 struct mem_cgroup *memcg, *old_memcg; bpf_mem_cache_alloc_flags() local
|