Lines Matching refs:mz
138 #define MEM_CGROUP_ZSTAT(mz, idx) ((mz)->count[(idx)]) argument
394 struct mem_cgroup_per_zone *mz, in __mem_cgroup_insert_exceeded() argument
402 if (mz->on_tree) in __mem_cgroup_insert_exceeded()
405 mz->usage_in_excess = new_usage_in_excess; in __mem_cgroup_insert_exceeded()
406 if (!mz->usage_in_excess) in __mem_cgroup_insert_exceeded()
412 if (mz->usage_in_excess < mz_node->usage_in_excess) in __mem_cgroup_insert_exceeded()
418 else if (mz->usage_in_excess >= mz_node->usage_in_excess) in __mem_cgroup_insert_exceeded()
421 rb_link_node(&mz->tree_node, parent, p); in __mem_cgroup_insert_exceeded()
422 rb_insert_color(&mz->tree_node, &mctz->rb_root); in __mem_cgroup_insert_exceeded()
423 mz->on_tree = true; in __mem_cgroup_insert_exceeded()
428 struct mem_cgroup_per_zone *mz, in __mem_cgroup_remove_exceeded() argument
431 if (!mz->on_tree) in __mem_cgroup_remove_exceeded()
433 rb_erase(&mz->tree_node, &mctz->rb_root); in __mem_cgroup_remove_exceeded()
434 mz->on_tree = false; in __mem_cgroup_remove_exceeded()
439 struct mem_cgroup_per_zone *mz, in mem_cgroup_remove_exceeded() argument
443 __mem_cgroup_remove_exceeded(mem, mz, mctz); in mem_cgroup_remove_exceeded()
451 struct mem_cgroup_per_zone *mz; in mem_cgroup_update_tree() local
462 mz = mem_cgroup_zoneinfo(mem, nid, zid); in mem_cgroup_update_tree()
468 if (excess || mz->on_tree) { in mem_cgroup_update_tree()
471 if (mz->on_tree) in mem_cgroup_update_tree()
472 __mem_cgroup_remove_exceeded(mem, mz, mctz); in mem_cgroup_update_tree()
477 __mem_cgroup_insert_exceeded(mem, mz, mctz, excess); in mem_cgroup_update_tree()
486 struct mem_cgroup_per_zone *mz; in mem_cgroup_remove_from_trees() local
491 mz = mem_cgroup_zoneinfo(mem, node, zone); in mem_cgroup_remove_from_trees()
493 mem_cgroup_remove_exceeded(mem, mz, mctz); in mem_cgroup_remove_from_trees()
502 struct mem_cgroup_per_zone *mz; in __mem_cgroup_largest_soft_limit_node() local
505 mz = NULL; in __mem_cgroup_largest_soft_limit_node()
510 mz = rb_entry(rightmost, struct mem_cgroup_per_zone, tree_node); in __mem_cgroup_largest_soft_limit_node()
516 __mem_cgroup_remove_exceeded(mz->mem, mz, mctz); in __mem_cgroup_largest_soft_limit_node()
517 if (!res_counter_soft_limit_excess(&mz->mem->res) || in __mem_cgroup_largest_soft_limit_node()
518 !css_tryget(&mz->mem->css)) in __mem_cgroup_largest_soft_limit_node()
521 return mz; in __mem_cgroup_largest_soft_limit_node()
527 struct mem_cgroup_per_zone *mz; in mem_cgroup_largest_soft_limit_node() local
530 mz = __mem_cgroup_largest_soft_limit_node(mctz); in mem_cgroup_largest_soft_limit_node()
532 return mz; in mem_cgroup_largest_soft_limit_node()
631 struct mem_cgroup_per_zone *mz; in mem_cgroup_get_local_zonestat() local
636 mz = mem_cgroup_zoneinfo(mem, nid, zid); in mem_cgroup_get_local_zonestat()
637 total += MEM_CGROUP_ZSTAT(mz, idx); in mem_cgroup_get_local_zonestat()
833 struct mem_cgroup_per_zone *mz; in mem_cgroup_del_lru_list() local
846 mz = page_cgroup_zoneinfo(pc->mem_cgroup, page); in mem_cgroup_del_lru_list()
848 MEM_CGROUP_ZSTAT(mz, lru) -= 1 << compound_order(page); in mem_cgroup_del_lru_list()
867 struct mem_cgroup_per_zone *mz; in mem_cgroup_rotate_reclaimable_page() local
882 mz = page_cgroup_zoneinfo(pc->mem_cgroup, page); in mem_cgroup_rotate_reclaimable_page()
883 list_move_tail(&pc->lru, &mz->lists[lru]); in mem_cgroup_rotate_reclaimable_page()
888 struct mem_cgroup_per_zone *mz; in mem_cgroup_rotate_lru_list() local
902 mz = page_cgroup_zoneinfo(pc->mem_cgroup, page); in mem_cgroup_rotate_lru_list()
903 list_move(&pc->lru, &mz->lists[lru]); in mem_cgroup_rotate_lru_list()
909 struct mem_cgroup_per_zone *mz; in mem_cgroup_add_lru_list() local
919 mz = page_cgroup_zoneinfo(pc->mem_cgroup, page); in mem_cgroup_add_lru_list()
921 MEM_CGROUP_ZSTAT(mz, lru) += 1 << compound_order(page); in mem_cgroup_add_lru_list()
925 list_add(&pc->lru, &mz->lists[lru]); in mem_cgroup_add_lru_list()
1073 struct mem_cgroup_per_zone *mz = mem_cgroup_zoneinfo(memcg, nid, zid); in mem_cgroup_zone_nr_pages() local
1075 return MEM_CGROUP_ZSTAT(mz, lru); in mem_cgroup_zone_nr_pages()
1083 struct mem_cgroup_per_zone *mz = mem_cgroup_zoneinfo(memcg, nid, zid); in mem_cgroup_get_reclaim_stat() local
1085 return &mz->reclaim_stat; in mem_cgroup_get_reclaim_stat()
1092 struct mem_cgroup_per_zone *mz; in mem_cgroup_get_reclaim_stat_from_page() local
1102 mz = page_cgroup_zoneinfo(pc->mem_cgroup, page); in mem_cgroup_get_reclaim_stat_from_page()
1103 return &mz->reclaim_stat; in mem_cgroup_get_reclaim_stat_from_page()
1121 struct mem_cgroup_per_zone *mz; in mem_cgroup_isolate_pages() local
1126 mz = mem_cgroup_zoneinfo(mem_cont, nid, zid); in mem_cgroup_isolate_pages()
1127 src = &mz->lists[lru]; in mem_cgroup_isolate_pages()
2238 struct mem_cgroup_per_zone *mz; in mem_cgroup_split_huge_fixup() local
2246 mz = page_cgroup_zoneinfo(head_pc->mem_cgroup, head); in mem_cgroup_split_huge_fixup()
2247 MEM_CGROUP_ZSTAT(mz, lru) -= 1; in mem_cgroup_split_huge_fixup()
3291 struct mem_cgroup_per_zone *mz, *next_mz = NULL; in mem_cgroup_soft_limit_reclaim() local
3308 mz = next_mz; in mem_cgroup_soft_limit_reclaim()
3310 mz = mem_cgroup_largest_soft_limit_node(mctz); in mem_cgroup_soft_limit_reclaim()
3311 if (!mz) in mem_cgroup_soft_limit_reclaim()
3314 reclaimed = mem_cgroup_hierarchical_reclaim(mz->mem, zone, in mem_cgroup_soft_limit_reclaim()
3340 if (next_mz == mz) { in mem_cgroup_soft_limit_reclaim()
3347 __mem_cgroup_remove_exceeded(mz->mem, mz, mctz); in mem_cgroup_soft_limit_reclaim()
3348 excess = res_counter_soft_limit_excess(&mz->mem->res); in mem_cgroup_soft_limit_reclaim()
3358 __mem_cgroup_insert_exceeded(mz->mem, mz, mctz, excess); in mem_cgroup_soft_limit_reclaim()
3360 css_put(&mz->mem->css); in mem_cgroup_soft_limit_reclaim()
3385 struct mem_cgroup_per_zone *mz; in mem_cgroup_force_empty_list() local
3392 mz = mem_cgroup_zoneinfo(mem, node, zid); in mem_cgroup_force_empty_list()
3393 list = &mz->lists[lru]; in mem_cgroup_force_empty_list()
3395 loop = MEM_CGROUP_ZSTAT(mz, lru); in mem_cgroup_force_empty_list()
3886 struct mem_cgroup_per_zone *mz; in mem_control_stat_show() local
3892 mz = mem_cgroup_zoneinfo(mem_cont, nid, zid); in mem_control_stat_show()
3895 mz->reclaim_stat.recent_rotated[0]; in mem_control_stat_show()
3897 mz->reclaim_stat.recent_rotated[1]; in mem_control_stat_show()
3899 mz->reclaim_stat.recent_scanned[0]; in mem_control_stat_show()
3901 mz->reclaim_stat.recent_scanned[1]; in mem_control_stat_show()
4392 struct mem_cgroup_per_zone *mz; in alloc_mem_cgroup_per_zone_info() local
4411 mz = &pn->zoneinfo[zone]; in alloc_mem_cgroup_per_zone_info()
4413 INIT_LIST_HEAD(&mz->lists[l]); in alloc_mem_cgroup_per_zone_info()
4414 mz->usage_in_excess = 0; in alloc_mem_cgroup_per_zone_info()
4415 mz->on_tree = false; in alloc_mem_cgroup_per_zone_info()
4416 mz->mem = mem; in alloc_mem_cgroup_per_zone_info()