Lines Matching refs:mem_cgroup

79 static struct mem_cgroup *root_mem_cgroup __read_mostly;
136 struct mem_cgroup *position;
154 struct mem_cgroup *memcg; /* Back pointer, we cannot */
221 struct mem_cgroup *memcg;
235 int (*register_event)(struct mem_cgroup *memcg,
242 void (*unregister_event)(struct mem_cgroup *memcg,
254 static void mem_cgroup_threshold(struct mem_cgroup *memcg);
255 static void mem_cgroup_oom_notify(struct mem_cgroup *memcg);
263 struct mem_cgroup { struct
358 bool memcg_kmem_is_active(struct mem_cgroup *memcg) in memcg_kmem_is_active() argument
375 struct mem_cgroup *from;
376 struct mem_cgroup *to;
424 struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *s) in mem_cgroup_from_css()
426 return s ? container_of(s, struct mem_cgroup, css) : NULL; in mem_cgroup_from_css()
430 struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg) in memcg_to_vmpressure()
439 return &container_of(vmpr, struct mem_cgroup, vmpressure)->css; in vmpressure_to_css()
442 static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg) in mem_cgroup_is_root()
453 static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg) in mem_cgroup_id()
464 static inline struct mem_cgroup *mem_cgroup_from_id(unsigned short id) in mem_cgroup_from_id()
478 struct mem_cgroup *memcg; in sock_update_memcg()
513 struct mem_cgroup *memcg; in sock_release_memcg()
520 struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg) in tcp_proto_cgroup()
586 mem_cgroup_zone_zoneinfo(struct mem_cgroup *memcg, struct zone *zone) in mem_cgroup_zone_zoneinfo()
594 struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg) in mem_cgroup_css()
600 mem_cgroup_page_zoneinfo(struct mem_cgroup *memcg, struct page *page) in mem_cgroup_page_zoneinfo()
674 static unsigned long soft_limit_excess(struct mem_cgroup *memcg) in soft_limit_excess()
686 static void mem_cgroup_update_tree(struct mem_cgroup *memcg, struct page *page) in mem_cgroup_update_tree()
721 static void mem_cgroup_remove_from_trees(struct mem_cgroup *memcg) in mem_cgroup_remove_from_trees()
792 static long mem_cgroup_read_stat(struct mem_cgroup *memcg, in mem_cgroup_read_stat()
810 static unsigned long mem_cgroup_read_events(struct mem_cgroup *memcg, in mem_cgroup_read_events()
828 static void mem_cgroup_charge_statistics(struct mem_cgroup *memcg, in mem_cgroup_charge_statistics()
866 static unsigned long mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg, in mem_cgroup_node_nr_lru_pages()
889 static unsigned long mem_cgroup_nr_lru_pages(struct mem_cgroup *memcg, in mem_cgroup_nr_lru_pages()
900 static bool mem_cgroup_event_ratelimit(struct mem_cgroup *memcg, in mem_cgroup_event_ratelimit()
932 static void memcg_check_events(struct mem_cgroup *memcg, struct page *page) in memcg_check_events()
956 struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p) in mem_cgroup_from_task()
969 static struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm) in get_mem_cgroup_from_mm()
971 struct mem_cgroup *memcg = NULL; in get_mem_cgroup_from_mm()
1009 struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root, in mem_cgroup_iter()
1010 struct mem_cgroup *prev, in mem_cgroup_iter()
1015 struct mem_cgroup *memcg = NULL; in mem_cgroup_iter()
1016 struct mem_cgroup *pos = NULL; in mem_cgroup_iter()
1131 void mem_cgroup_iter_break(struct mem_cgroup *root, in mem_cgroup_iter_break()
1132 struct mem_cgroup *prev) in mem_cgroup_iter_break()
1157 struct mem_cgroup *memcg; in __mem_cgroup_count_vm_event()
1189 struct mem_cgroup *memcg) in mem_cgroup_zone_lruvec()
1224 struct mem_cgroup *memcg; in mem_cgroup_page_lruvec()
1232 memcg = page->mem_cgroup; in mem_cgroup_page_lruvec()
1277 bool mem_cgroup_is_descendant(struct mem_cgroup *memcg, struct mem_cgroup *root) in mem_cgroup_is_descendant()
1286 bool task_in_mem_cgroup(struct task_struct *task, struct mem_cgroup *memcg) in task_in_mem_cgroup()
1288 struct mem_cgroup *task_memcg; in task_in_mem_cgroup()
1334 struct mem_cgroup *memcg; in mem_cgroup_lruvec_online()
1346 container_of(counter, struct mem_cgroup, member)
1355 static unsigned long mem_cgroup_margin(struct mem_cgroup *memcg) in mem_cgroup_margin()
1376 int mem_cgroup_swappiness(struct mem_cgroup *memcg) in mem_cgroup_swappiness()
1392 static bool mem_cgroup_under_move(struct mem_cgroup *memcg) in mem_cgroup_under_move()
1394 struct mem_cgroup *from; in mem_cgroup_under_move()
1395 struct mem_cgroup *to; in mem_cgroup_under_move()
1414 static bool mem_cgroup_wait_acct_move(struct mem_cgroup *memcg) in mem_cgroup_wait_acct_move()
1439 void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) in mem_cgroup_print_oom_info()
1443 struct mem_cgroup *iter; in mem_cgroup_print_oom_info()
1497 static int mem_cgroup_count_children(struct mem_cgroup *memcg) in mem_cgroup_count_children()
1500 struct mem_cgroup *iter; in mem_cgroup_count_children()
1510 static unsigned long mem_cgroup_get_limit(struct mem_cgroup *memcg) in mem_cgroup_get_limit()
1524 static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask, in mem_cgroup_out_of_memory()
1527 struct mem_cgroup *iter; in mem_cgroup_out_of_memory()
1607 static bool test_mem_cgroup_node_reclaimable(struct mem_cgroup *memcg, in test_mem_cgroup_node_reclaimable()
1626 static void mem_cgroup_may_update_nodemask(struct mem_cgroup *memcg) in mem_cgroup_may_update_nodemask()
1663 int mem_cgroup_select_victim_node(struct mem_cgroup *memcg) in mem_cgroup_select_victim_node()
1686 int mem_cgroup_select_victim_node(struct mem_cgroup *memcg) in mem_cgroup_select_victim_node()
1692 static int mem_cgroup_soft_reclaim(struct mem_cgroup *root_memcg, in mem_cgroup_soft_reclaim()
1697 struct mem_cgroup *victim = NULL; in mem_cgroup_soft_reclaim()
1755 static bool mem_cgroup_oom_trylock(struct mem_cgroup *memcg) in mem_cgroup_oom_trylock()
1757 struct mem_cgroup *iter, *failed = NULL; in mem_cgroup_oom_trylock()
1794 static void mem_cgroup_oom_unlock(struct mem_cgroup *memcg) in mem_cgroup_oom_unlock()
1796 struct mem_cgroup *iter; in mem_cgroup_oom_unlock()
1805 static void mem_cgroup_mark_under_oom(struct mem_cgroup *memcg) in mem_cgroup_mark_under_oom()
1807 struct mem_cgroup *iter; in mem_cgroup_mark_under_oom()
1813 static void mem_cgroup_unmark_under_oom(struct mem_cgroup *memcg) in mem_cgroup_unmark_under_oom()
1815 struct mem_cgroup *iter; in mem_cgroup_unmark_under_oom()
1829 struct mem_cgroup *memcg;
1836 struct mem_cgroup *wake_memcg = (struct mem_cgroup *)arg; in memcg_oom_wake_function()
1837 struct mem_cgroup *oom_wait_memcg; in memcg_oom_wake_function()
1849 static void memcg_wakeup_oom(struct mem_cgroup *memcg) in memcg_wakeup_oom()
1856 static void memcg_oom_recover(struct mem_cgroup *memcg) in memcg_oom_recover()
1862 static void mem_cgroup_oom(struct mem_cgroup *memcg, gfp_t mask, int order) in mem_cgroup_oom()
1905 struct mem_cgroup *memcg = current->memcg_oom.memcg; in mem_cgroup_oom_synchronize()
1969 struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page) in mem_cgroup_begin_page_stat()
1971 struct mem_cgroup *memcg; in mem_cgroup_begin_page_stat()
1991 memcg = page->mem_cgroup; in mem_cgroup_begin_page_stat()
1999 if (memcg != page->mem_cgroup) { in mem_cgroup_begin_page_stat()
2019 void mem_cgroup_end_page_stat(struct mem_cgroup *memcg) in mem_cgroup_end_page_stat()
2041 void mem_cgroup_update_page_stat(struct mem_cgroup *memcg, in mem_cgroup_update_page_stat()
2056 struct mem_cgroup *cached; /* this never be root cgroup */
2076 static bool consume_stock(struct mem_cgroup *memcg, unsigned int nr_pages) in consume_stock()
2098 struct mem_cgroup *old = stock->cached; in drain_stock()
2125 static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages) in refill_stock()
2141 static void drain_all_stock(struct mem_cgroup *root_memcg) in drain_all_stock()
2153 struct mem_cgroup *memcg; in drain_all_stock()
2176 static void mem_cgroup_drain_pcp_counter(struct mem_cgroup *memcg, int cpu) in mem_cgroup_drain_pcp_counter()
2202 struct mem_cgroup *iter; in memcg_cpu_hotplug_callback()
2218 static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, in try_charge()
2223 struct mem_cgroup *mem_over_limit; in try_charge()
2342 static void cancel_charge(struct mem_cgroup *memcg, unsigned int nr_pages) in cancel_charge()
2364 struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page) in try_get_mem_cgroup_from_page()
2366 struct mem_cgroup *memcg; in try_get_mem_cgroup_from_page()
2372 memcg = page->mem_cgroup; in try_get_mem_cgroup_from_page()
2419 static void commit_charge(struct page *page, struct mem_cgroup *memcg, in commit_charge()
2424 VM_BUG_ON_PAGE(page->mem_cgroup, page); in commit_charge()
2447 page->mem_cgroup = memcg; in commit_charge()
2454 int memcg_charge_kmem(struct mem_cgroup *memcg, gfp_t gfp, in memcg_charge_kmem()
2492 void memcg_uncharge_kmem(struct mem_cgroup *memcg, unsigned long nr_pages) in memcg_uncharge_kmem()
2508 int memcg_cache_id(struct mem_cgroup *memcg) in memcg_cache_id()
2559 struct mem_cgroup *memcg;
2568 struct mem_cgroup *memcg = cw->memcg; in memcg_kmem_cache_create_func()
2580 static void __memcg_schedule_kmem_cache_create(struct mem_cgroup *memcg, in __memcg_schedule_kmem_cache_create()
2598 static void memcg_schedule_kmem_cache_create(struct mem_cgroup *memcg, in memcg_schedule_kmem_cache_create()
2632 struct mem_cgroup *memcg; in __memcg_kmem_get_cache()
2689 __memcg_kmem_newpage_charge(gfp_t gfp, struct mem_cgroup **_memcg, int order) in __memcg_kmem_newpage_charge()
2691 struct mem_cgroup *memcg; in __memcg_kmem_newpage_charge()
2711 void __memcg_kmem_commit_charge(struct page *page, struct mem_cgroup *memcg, in __memcg_kmem_commit_charge()
2721 page->mem_cgroup = memcg; in __memcg_kmem_commit_charge()
2726 struct mem_cgroup *memcg = page->mem_cgroup; in __memcg_kmem_uncharge_pages()
2734 page->mem_cgroup = NULL; in __memcg_kmem_uncharge_pages()
2737 struct mem_cgroup *__mem_cgroup_from_kmem(void *ptr) in __mem_cgroup_from_kmem()
2739 struct mem_cgroup *memcg = NULL; in __mem_cgroup_from_kmem()
2750 memcg = page->mem_cgroup; in __mem_cgroup_from_kmem()
2772 head[i].mem_cgroup = head->mem_cgroup; in mem_cgroup_split_huge_fixup()
2774 __this_cpu_sub(head->mem_cgroup->stat->count[MEM_CGROUP_STAT_RSS_HUGE], in mem_cgroup_split_huge_fixup()
2780 static void mem_cgroup_swap_statistics(struct mem_cgroup *memcg, in mem_cgroup_swap_statistics()
2802 struct mem_cgroup *from, struct mem_cgroup *to) in mem_cgroup_move_swap_account()
2818 struct mem_cgroup *from, struct mem_cgroup *to) in mem_cgroup_move_swap_account()
2826 static int mem_cgroup_resize_limit(struct mem_cgroup *memcg, in mem_cgroup_resize_limit()
2881 static int mem_cgroup_resize_memsw_limit(struct mem_cgroup *memcg, in mem_cgroup_resize_memsw_limit()
3012 static inline bool memcg_has_children(struct mem_cgroup *memcg) in memcg_has_children()
3036 static int mem_cgroup_force_empty(struct mem_cgroup *memcg) in mem_cgroup_force_empty()
3066 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in mem_cgroup_force_empty_write()
3083 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_hierarchy_write()
3084 struct mem_cgroup *parent_memcg = mem_cgroup_from_css(memcg->css.parent); in mem_cgroup_hierarchy_write()
3114 static unsigned long tree_stat(struct mem_cgroup *memcg, in tree_stat()
3117 struct mem_cgroup *iter; in tree_stat()
3129 static inline u64 mem_cgroup_usage(struct mem_cgroup *memcg, bool swap) in mem_cgroup_usage()
3158 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_read_u64()
3196 static int memcg_activate_kmem(struct mem_cgroup *memcg, in memcg_activate_kmem()
3253 static int memcg_update_kmem_limit(struct mem_cgroup *memcg, in memcg_update_kmem_limit()
3267 static int memcg_propagate_kmem(struct mem_cgroup *memcg) in memcg_propagate_kmem()
3270 struct mem_cgroup *parent = parent_mem_cgroup(memcg); in memcg_propagate_kmem()
3286 static int memcg_update_kmem_limit(struct mem_cgroup *memcg, in memcg_update_kmem_limit()
3300 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in mem_cgroup_write()
3338 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in mem_cgroup_reset()
3379 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_move_charge_write()
3418 struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); in memcg_numa_stat_show()
3432 struct mem_cgroup *iter; in memcg_numa_stat_show()
3454 struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); in memcg_stat_show()
3456 struct mem_cgroup *mi; in memcg_stat_show()
3550 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_swappiness_read()
3558 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_swappiness_write()
3571 static void __mem_cgroup_threshold(struct mem_cgroup *memcg, bool swap) in __mem_cgroup_threshold()
3622 static void mem_cgroup_threshold(struct mem_cgroup *memcg) in mem_cgroup_threshold()
3647 static int mem_cgroup_oom_notify_cb(struct mem_cgroup *memcg) in mem_cgroup_oom_notify_cb()
3660 static void mem_cgroup_oom_notify(struct mem_cgroup *memcg) in mem_cgroup_oom_notify()
3662 struct mem_cgroup *iter; in mem_cgroup_oom_notify()
3668 static int __mem_cgroup_usage_register_event(struct mem_cgroup *memcg, in __mem_cgroup_usage_register_event()
3751 static int mem_cgroup_usage_register_event(struct mem_cgroup *memcg, in mem_cgroup_usage_register_event()
3757 static int memsw_cgroup_usage_register_event(struct mem_cgroup *memcg, in memsw_cgroup_usage_register_event()
3763 static void __mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg, in __mem_cgroup_usage_unregister_event()
3842 static void mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg, in mem_cgroup_usage_unregister_event()
3848 static void memsw_cgroup_usage_unregister_event(struct mem_cgroup *memcg, in memsw_cgroup_usage_unregister_event()
3854 static int mem_cgroup_oom_register_event(struct mem_cgroup *memcg, in mem_cgroup_oom_register_event()
3876 static void mem_cgroup_oom_unregister_event(struct mem_cgroup *memcg, in mem_cgroup_oom_unregister_event()
3895 struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(sf)); in mem_cgroup_oom_control_read()
3905 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_oom_control_write()
3919 static int memcg_init_kmem(struct mem_cgroup *memcg, struct cgroup_subsys *ss) in memcg_init_kmem()
3930 static void memcg_deactivate_kmem(struct mem_cgroup *memcg) in memcg_deactivate_kmem()
3933 struct mem_cgroup *parent, *child; in memcg_deactivate_kmem()
3976 static void memcg_destroy_kmem(struct mem_cgroup *memcg) in memcg_destroy_kmem()
3986 static int memcg_init_kmem(struct mem_cgroup *memcg, struct cgroup_subsys *ss) in memcg_init_kmem()
3991 static void memcg_deactivate_kmem(struct mem_cgroup *memcg) in memcg_deactivate_kmem()
3995 static void memcg_destroy_kmem(struct mem_cgroup *memcg) in memcg_destroy_kmem()
4022 struct mem_cgroup *memcg = event->memcg; in memcg_event_remove()
4046 struct mem_cgroup *memcg = event->memcg; in memcg_event_wake()
4096 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in memcg_write_event_control()
4334 static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node) in alloc_mem_cgroup_per_zone_info()
4364 static void free_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node) in free_mem_cgroup_per_zone_info()
4369 static struct mem_cgroup *mem_cgroup_alloc(void) in mem_cgroup_alloc()
4371 struct mem_cgroup *memcg; in mem_cgroup_alloc()
4374 size = sizeof(struct mem_cgroup); in mem_cgroup_alloc()
4403 static void __mem_cgroup_free(struct mem_cgroup *memcg) in __mem_cgroup_free()
4419 struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg) in parent_mem_cgroup()
4430 struct mem_cgroup *memcg; in mem_cgroup_css_alloc()
4474 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_css_online()
4475 struct mem_cgroup *parent = mem_cgroup_from_css(css->parent); in mem_cgroup_css_online()
4533 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_css_offline()
4555 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_css_free()
4576 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_css_reset()
4748 struct mem_cgroup *from, in mem_cgroup_move_account()
4749 struct mem_cgroup *to) in mem_cgroup_move_account()
4775 if (page->mem_cgroup != from) in mem_cgroup_move_account()
4801 page->mem_cgroup = to; in mem_cgroup_move_account()
4840 if (page->mem_cgroup == mc.from) { in get_mctgt_type()
4874 if (page->mem_cgroup == mc.from) { in get_mctgt_type_thp()
4948 struct mem_cgroup *from = mc.from; in __mem_cgroup_clear_mc()
4949 struct mem_cgroup *to = mc.to; in __mem_cgroup_clear_mc()
5006 struct mem_cgroup *memcg = mem_cgroup_from_css(css); in mem_cgroup_can_attach()
5017 struct mem_cgroup *from = mem_cgroup_from_task(p); in mem_cgroup_can_attach()
5247 struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); in memory_low_show()
5261 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in memory_low_write()
5277 struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); in memory_high_show()
5291 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in memory_high_write()
5313 struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); in memory_max_show()
5327 struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of)); in memory_max_write()
5345 struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); in memory_events_show()
5407 void mem_cgroup_events(struct mem_cgroup *memcg, in mem_cgroup_events()
5422 bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg) in mem_cgroup_low()
5469 gfp_t gfp_mask, struct mem_cgroup **memcgp) in mem_cgroup_try_charge()
5471 struct mem_cgroup *memcg = NULL; in mem_cgroup_try_charge()
5486 if (page->mem_cgroup) in mem_cgroup_try_charge()
5529 void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg, in mem_cgroup_commit_charge()
5577 void mem_cgroup_cancel_charge(struct page *page, struct mem_cgroup *memcg) in mem_cgroup_cancel_charge()
5599 static void uncharge_batch(struct mem_cgroup *memcg, unsigned long pgpgout, in uncharge_batch()
5628 struct mem_cgroup *memcg = NULL; in uncharge_list()
5646 if (!page->mem_cgroup) in uncharge_list()
5655 if (memcg != page->mem_cgroup) { in uncharge_list()
5661 memcg = page->mem_cgroup; in uncharge_list()
5675 page->mem_cgroup = NULL; in uncharge_list()
5698 if (!page->mem_cgroup) in mem_cgroup_uncharge()
5734 struct mem_cgroup *memcg; in mem_cgroup_migrate()
5749 if (newpage->mem_cgroup) in mem_cgroup_migrate()
5758 memcg = oldpage->mem_cgroup; in mem_cgroup_migrate()
5765 oldpage->mem_cgroup = NULL; in mem_cgroup_migrate()
5822 struct mem_cgroup *memcg; in mem_cgroup_swapout()
5831 memcg = page->mem_cgroup; in mem_cgroup_swapout()
5841 page->mem_cgroup = NULL; in mem_cgroup_swapout()
5859 struct mem_cgroup *memcg; in mem_cgroup_uncharge_swap()