Lines Matching refs:mem_cgroup

84 struct mem_cgroup *root_mem_cgroup __read_mostly;
88 DEFINE_PER_CPU(struct mem_cgroup *, int_active_memcg);
116 struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg) in memcg_to_vmpressure()
123 struct mem_cgroup *vmpressure_to_memcg(struct vmpressure *vmpr) in vmpressure_to_memcg()
125 return container_of(vmpr, struct mem_cgroup, vmpressure); in vmpressure_to_memcg()
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()
181 struct mem_cgroup *memcg; in obj_cgroup_release()
215 static inline struct obj_cgroup *__memcg_reparent_objcgs(struct mem_cgroup *memcg, in __memcg_reparent_objcgs()
216 struct mem_cgroup *parent, in __memcg_reparent_objcgs()
236 static void __mem_cgroup_flush_stats(struct mem_cgroup *memcg, bool force);
238 static inline void reparent_state_local(struct mem_cgroup *memcg, struct mem_cgroup *parent) in reparent_state_local()
258 static inline void reparent_state_local(struct mem_cgroup *memcg, struct mem_cgroup *parent) in reparent_state_local()
263 static inline void reparent_locks(struct mem_cgroup *memcg, struct mem_cgroup *parent, int nid) in reparent_locks()
270 static inline void reparent_unlocks(struct mem_cgroup *memcg, struct mem_cgroup *parent, int nid) in reparent_unlocks()
277 static void memcg_reparent_objcgs(struct mem_cgroup *memcg) in memcg_reparent_objcgs()
280 struct mem_cgroup *parent = parent_mem_cgroup(memcg); in memcg_reparent_objcgs()
336 struct mem_cgroup *memcg; in get_mem_cgroup_css_from_folio()
361 struct mem_cgroup *memcg; in page_cgroup_ino()
577 void reparent_memcg_lruvec_state_local(struct mem_cgroup *memcg, in reparent_memcg_lruvec_state_local()
578 struct mem_cgroup *parent, int idx) in reparent_memcg_lruvec_state_local()
717 static inline void memcg_rstat_updated(struct mem_cgroup *memcg, long val, in memcg_rstat_updated()
749 static void __mem_cgroup_flush_stats(struct mem_cgroup *memcg, bool force) in __mem_cgroup_flush_stats()
774 void mem_cgroup_flush_stats(struct mem_cgroup *memcg) in mem_cgroup_flush_stats()
785 void mem_cgroup_flush_stats_ratelimited(struct mem_cgroup *memcg) in mem_cgroup_flush_stats_ratelimited()
802 unsigned long memcg_page_state(struct mem_cgroup *memcg, int idx) in memcg_page_state()
853 static inline struct mem_cgroup *get_non_dying_memcg_start(struct mem_cgroup *memcg, in get_non_dying_memcg_start()
879 static inline struct mem_cgroup *get_non_dying_memcg_start(struct mem_cgroup *memcg, in get_non_dying_memcg_start()
890 static void __mod_memcg_state(struct mem_cgroup *memcg, in __mod_memcg_state()
916 void mod_memcg_state(struct mem_cgroup *memcg, enum memcg_stat_item idx, in mod_memcg_state()
931 unsigned long memcg_page_state_local(struct mem_cgroup *memcg, int idx) in memcg_page_state_local()
947 void reparent_memcg_state_local(struct mem_cgroup *memcg, in reparent_memcg_state_local()
948 struct mem_cgroup *parent, int idx) in reparent_memcg_state_local()
960 struct mem_cgroup *memcg = pn->memcg; in __mod_memcg_lruvec_state()
988 struct mem_cgroup *memcg; in mod_memcg_lruvec_state()
1024 struct mem_cgroup *memcg; in lruvec_stat_mod_folio()
1046 struct mem_cgroup *memcg; in mod_lruvec_kmem_state()
1073 void count_memcg_events(struct mem_cgroup *memcg, enum vm_event_item idx, in count_memcg_events()
1094 unsigned long memcg_events(struct mem_cgroup *memcg, int event) in memcg_events()
1113 unsigned long memcg_events_local(struct mem_cgroup *memcg, int event) in memcg_events_local()
1124 struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p) in mem_cgroup_from_task()
1138 static __always_inline struct mem_cgroup *active_memcg(void) in active_memcg()
1157 struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm) in get_mem_cgroup_from_mm()
1159 struct mem_cgroup *memcg; in get_mem_cgroup_from_mm()
1199 struct mem_cgroup *get_mem_cgroup_from_current(void) in get_mem_cgroup_from_current()
1201 struct mem_cgroup *memcg; in get_mem_cgroup_from_current()
1223 struct mem_cgroup *get_mem_cgroup_from_folio(struct folio *folio) in get_mem_cgroup_from_folio()
1225 struct mem_cgroup *memcg; in get_mem_cgroup_from_folio()
1258 struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root, in mem_cgroup_iter()
1259 struct mem_cgroup *prev, in mem_cgroup_iter()
1264 struct mem_cgroup *pos; in mem_cgroup_iter()
1265 struct mem_cgroup *next; in mem_cgroup_iter()
1350 void mem_cgroup_iter_break(struct mem_cgroup *root, in mem_cgroup_iter_break()
1351 struct mem_cgroup *prev) in mem_cgroup_iter_break()
1359 static void __invalidate_reclaim_iterators(struct mem_cgroup *from, in __invalidate_reclaim_iterators()
1360 struct mem_cgroup *dead_memcg) in __invalidate_reclaim_iterators()
1373 static void invalidate_reclaim_iterators(struct mem_cgroup *dead_memcg) in invalidate_reclaim_iterators()
1375 struct mem_cgroup *memcg = dead_memcg; in invalidate_reclaim_iterators()
1376 struct mem_cgroup *last; in invalidate_reclaim_iterators()
1407 void mem_cgroup_scan_tasks(struct mem_cgroup *memcg, in mem_cgroup_scan_tasks()
1410 struct mem_cgroup *iter; in mem_cgroup_scan_tasks()
1563 static unsigned long mem_cgroup_margin(struct mem_cgroup *memcg) in mem_cgroup_margin()
1712 unsigned long memcg_page_state_output(struct mem_cgroup *memcg, int item) in memcg_page_state_output()
1719 unsigned long memcg_page_state_local_output(struct mem_cgroup *memcg, int item) in memcg_page_state_local_output()
1738 static void memcg_stat_format(struct mem_cgroup *memcg, struct seq_buf *s) in memcg_stat_format()
1796 static void memory_stat_format(struct mem_cgroup *memcg, struct seq_buf *s) in memory_stat_format()
1815 void mem_cgroup_print_oom_context(struct mem_cgroup *memcg, struct task_struct *p) in mem_cgroup_print_oom_context()
1836 void mem_cgroup_print_oom_meminfo(struct mem_cgroup *memcg) in mem_cgroup_print_oom_meminfo()
1880 unsigned long mem_cgroup_get_max(struct mem_cgroup *memcg) in mem_cgroup_get_max()
1899 void __memcg_memory_event(struct mem_cgroup *memcg, in __memcg_memory_event()
1930 static bool mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, in mem_cgroup_out_of_memory()
1963 static bool mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int order) in mem_cgroup_oom()
1992 struct mem_cgroup *mem_cgroup_get_oom_group(struct task_struct *victim, in mem_cgroup_get_oom_group()
1993 struct mem_cgroup *oom_domain) in mem_cgroup_get_oom_group()
1995 struct mem_cgroup *oom_group = NULL; in mem_cgroup_get_oom_group()
1996 struct mem_cgroup *memcg; in mem_cgroup_get_oom_group()
2039 void mem_cgroup_print_oom_group(struct mem_cgroup *memcg) in mem_cgroup_print_oom_group()
2055 struct mem_cgroup *cached[NR_MEMCG_STOCK];
2111 struct mem_cgroup *root_memcg);
2124 static bool consume_stock(struct mem_cgroup *memcg, unsigned int nr_pages) in consume_stock()
2159 static void memcg_uncharge(struct mem_cgroup *memcg, unsigned int nr_pages) in memcg_uncharge()
2171 struct mem_cgroup *old = READ_ONCE(stock->cached[i]); in drain_stock()
2227 static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) in refill_stock()
2230 struct mem_cgroup *cached; in refill_stock()
2287 struct mem_cgroup *root_memcg) in is_memcg_drain_needed()
2289 struct mem_cgroup *memcg; in is_memcg_drain_needed()
2326 void drain_all_stock(struct mem_cgroup *root_memcg) in drain_all_stock()
2378 static unsigned long reclaim_high(struct mem_cgroup *memcg, in reclaim_high()
2407 struct mem_cgroup *memcg; in high_work_func()
2409 memcg = container_of(work, struct mem_cgroup, high_work); in high_work_func()
2484 static u64 mem_find_max_overage(struct mem_cgroup *memcg) in mem_find_max_overage()
2498 static u64 swap_find_max_overage(struct mem_cgroup *memcg) in swap_find_max_overage()
2518 static unsigned long calculate_high_delay(struct mem_cgroup *memcg, in calculate_high_delay()
2562 struct mem_cgroup *memcg; in __mem_cgroup_handle_over_high()
2645 static int try_charge_memcg(struct mem_cgroup *memcg, gfp_t gfp_mask, in try_charge_memcg()
2650 struct mem_cgroup *mem_over_limit; in try_charge_memcg()
2854 static inline int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, in try_charge()
2877 static inline void account_slab_nmi_safe(struct mem_cgroup *memcg, in account_slab_nmi_safe()
2898 static inline void account_slab_nmi_safe(struct mem_cgroup *memcg, in account_slab_nmi_safe()
2913 struct mem_cgroup *memcg; in mod_objcg_mlstate()
2922 struct mem_cgroup *mem_cgroup_from_obj_slab(struct slab *slab, void *p) in mem_cgroup_from_obj_slab()
2961 struct mem_cgroup *mem_cgroup_from_virt(void *p) in mem_cgroup_from_virt()
2974 static struct obj_cgroup *__get_obj_cgroup_from_memcg(struct mem_cgroup *memcg, in __get_obj_cgroup_from_memcg()
2987 static inline struct obj_cgroup *get_obj_cgroup_from_memcg(struct mem_cgroup *memcg, in get_obj_cgroup_from_memcg()
3001 struct mem_cgroup *memcg; in current_objcg_update()
3052 struct mem_cgroup *memcg; in current_obj_cgroup()
3108 static inline void account_kmem_nmi_safe(struct mem_cgroup *memcg, int val) in account_kmem_nmi_safe()
3119 static inline void account_kmem_nmi_safe(struct mem_cgroup *memcg, int val) in account_kmem_nmi_safe()
3133 struct mem_cgroup *memcg; in obj_cgroup_uncharge_pages()
3156 struct mem_cgroup *memcg; in obj_cgroup_charge_pages()
3392 struct mem_cgroup *memcg; in drain_obj_stock_slot()
3432 struct mem_cgroup *root_memcg) in obj_stock_flush_required()
3435 struct mem_cgroup *memcg; in obj_stock_flush_required()
3629 struct mem_cgroup *memcg; in __memcg_slab_post_alloc_hook()
3749 static void memcg_online_kmem(struct mem_cgroup *memcg) in memcg_online_kmem()
3762 static void memcg_offline_kmem(struct mem_cgroup *memcg) in memcg_offline_kmem()
3764 struct mem_cgroup *parent; in memcg_offline_kmem()
3780 static int memcg_wb_domain_init(struct mem_cgroup *memcg, gfp_t gfp) in memcg_wb_domain_init()
3785 static void memcg_wb_domain_exit(struct mem_cgroup *memcg) in memcg_wb_domain_exit()
3790 static void memcg_wb_domain_size_changed(struct mem_cgroup *memcg) in memcg_wb_domain_size_changed()
3797 struct mem_cgroup *memcg = mem_cgroup_from_css(wb->memcg_css); in mem_cgroup_wb_domain()
3827 struct mem_cgroup *memcg = mem_cgroup_from_css(wb->memcg_css); in mem_cgroup_wb_stats()
3828 struct mem_cgroup *parent; in mem_cgroup_wb_stats()
3895 struct mem_cgroup *memcg = folio_memcg(folio); in mem_cgroup_track_foreign_dirty_slowpath()
3947 struct mem_cgroup *memcg = mem_cgroup_from_css(wb->memcg_css); in mem_cgroup_flush_foreign()
3974 static int memcg_wb_domain_init(struct mem_cgroup *memcg, gfp_t gfp) in memcg_wb_domain_init()
3979 static void memcg_wb_domain_exit(struct mem_cgroup *memcg) in memcg_wb_domain_exit()
3983 static void memcg_wb_domain_size_changed(struct mem_cgroup *memcg) in memcg_wb_domain_size_changed()
4016 static void mem_cgroup_private_id_remove(struct mem_cgroup *memcg) in mem_cgroup_private_id_remove()
4024 static inline void mem_cgroup_private_id_put(struct mem_cgroup *memcg, unsigned int n) in mem_cgroup_private_id_put()
4034 struct mem_cgroup *mem_cgroup_private_id_get_online(struct mem_cgroup *memcg, unsigned int n) in mem_cgroup_private_id_get_online()
4056 struct mem_cgroup *mem_cgroup_from_private_id(unsigned short id) in mem_cgroup_from_private_id()
4062 struct mem_cgroup *mem_cgroup_get_from_id(u64 id) in mem_cgroup_get_from_id()
4066 struct mem_cgroup *memcg = NULL; in mem_cgroup_get_from_id()
4074 memcg = container_of(css, struct mem_cgroup, css); in mem_cgroup_get_from_id()
4091 static bool alloc_mem_cgroup_per_node_info(struct mem_cgroup *memcg, int node) in alloc_mem_cgroup_per_node_info()
4122 static void __mem_cgroup_free(struct mem_cgroup *memcg) in __mem_cgroup_free()
4140 static void mem_cgroup_free(struct mem_cgroup *memcg) in mem_cgroup_free()
4147 static struct mem_cgroup *mem_cgroup_alloc(struct mem_cgroup *parent) in mem_cgroup_alloc()
4151 struct mem_cgroup *memcg; in mem_cgroup_alloc()
4220 struct mem_cgroup *parent = mem_cgroup_from_css(parent_css); in mem_cgroup_css_alloc()
4221 struct mem_cgroup *memcg, *old_memcg; in mem_cgroup_css_alloc()
4273 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_css_online()
4350 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_css_offline()
4377 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_css_released()
4385 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_css_free()
4423 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_css_reset()
4498 static void flush_nmi_stats(struct mem_cgroup *memcg, struct mem_cgroup *parent) in flush_nmi_stats()
4549 static void flush_nmi_stats(struct mem_cgroup *memcg, struct mem_cgroup *parent) in flush_nmi_stats()
4555 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_css_rstat_flush()
4556 struct mem_cgroup *parent = parent_mem_cgroup(memcg); in mem_cgroup_css_rstat_flush()
4696 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in memory_current_read()
4720 struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(sf)); in memory_peak_show()
4735 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in peak_release()
4753 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in peak_write()
4778 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in memory_peak_write()
4795 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in memory_min_write()
4818 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in memory_low_write()
4841 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in memory_high_write()
4900 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in memory_max_write()
4975 struct mem_cgroup *memcg = mem_cgroup_from_seq(m); in memory_events_show()
4983 struct mem_cgroup *memcg = mem_cgroup_from_seq(m); in memory_events_local_show()
4991 struct mem_cgroup *memcg = mem_cgroup_from_seq(m); in memory_stat_show()
5015 struct mem_cgroup *memcg = mem_cgroup_from_seq(m); in memory_numa_stat_show()
5044 struct mem_cgroup *memcg = mem_cgroup_from_seq(m); in memory_oom_group_show()
5054 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in memory_oom_group_write()
5076 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in memory_reclaim()
5127 .file_offset = offsetof(struct mem_cgroup, events_file),
5133 .file_offset = offsetof(struct mem_cgroup, events_local_file),
5186 void mem_cgroup_calculate_protection(struct mem_cgroup *root, in mem_cgroup_calculate_protection()
5187 struct mem_cgroup *memcg) in mem_cgroup_calculate_protection()
5201 static int charge_memcg(struct folio *folio, struct mem_cgroup *memcg, in charge_memcg()
5223 struct mem_cgroup *memcg; in __mem_cgroup_charge()
5247 struct mem_cgroup *memcg = get_mem_cgroup_from_current(); in mem_cgroup_charge_hugetlb()
5282 struct mem_cgroup *memcg; in mem_cgroup_swapin_charge_folio()
5315 struct mem_cgroup *memcg; in uncharge_batch()
5458 struct mem_cgroup *memcg; in mem_cgroup_replace_folio()
5567 struct mem_cgroup *memcg; in mem_cgroup_sk_alloc()
5590 struct mem_cgroup *memcg = mem_cgroup_from_sk(sk); in mem_cgroup_sk_free()
5598 struct mem_cgroup *memcg; in mem_cgroup_sk_inherit()
5624 struct mem_cgroup *memcg = mem_cgroup_from_sk(sk); in mem_cgroup_sk_charge()
5644 struct mem_cgroup *memcg = mem_cgroup_from_sk(sk); in mem_cgroup_sk_uncharge()
5713 memcg_size = struct_size_t(struct mem_cgroup, nodeinfo, nr_node_ids); in mem_cgroup_init()
5737 struct mem_cgroup *memcg; in __mem_cgroup_try_charge_swap()
5784 struct mem_cgroup *memcg; in __mem_cgroup_uncharge_swap()
5801 long mem_cgroup_get_nr_swap_pages(struct mem_cgroup *memcg) in mem_cgroup_get_nr_swap_pages()
5816 struct mem_cgroup *memcg; in mem_cgroup_swap_full()
5858 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in swap_current_read()
5865 struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(sf)); in swap_peak_show()
5873 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in swap_peak_write()
5888 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in swap_high_write()
5911 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in swap_max_write()
5927 struct mem_cgroup *memcg = mem_cgroup_from_seq(m); in swap_events_show()
5968 .file_offset = offsetof(struct mem_cgroup, swap_events_file),
5989 struct mem_cgroup *memcg, *original_memcg; in obj_cgroup_may_zswap()
6030 struct mem_cgroup *memcg; in obj_cgroup_charge_zswap()
6062 struct mem_cgroup *memcg; in obj_cgroup_uncharge_zswap()
6081 bool mem_cgroup_zswap_writeback_enabled(struct mem_cgroup *memcg) in mem_cgroup_zswap_writeback_enabled()
6097 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in zswap_current_read()
6112 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in zswap_max_write()
6128 struct mem_cgroup *memcg = mem_cgroup_from_seq(m); in zswap_writeback_show()
6137 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in zswap_writeback_write()
6190 void mem_cgroup_node_filter_allowed(struct mem_cgroup *memcg, nodemask_t *mask) in mem_cgroup_node_filter_allowed()
6207 void mem_cgroup_show_protected_memory(struct mem_cgroup *memcg) in mem_cgroup_show_protected_memory()