Lines Matching refs:memcg

157 	char *memcg;  in test_memcg_current()  local
159 memcg = cg_name(root, "memcg_test"); in test_memcg_current()
160 if (!memcg) in test_memcg_current()
163 if (cg_create(memcg)) in test_memcg_current()
166 current = cg_read_long(memcg, "memory.current"); in test_memcg_current()
170 if (cg_run(memcg, alloc_anon_50M_check, NULL)) in test_memcg_current()
173 if (cg_run(memcg, alloc_pagecache_50M_check, NULL)) in test_memcg_current()
179 cg_destroy(memcg); in test_memcg_current()
180 free(memcg); in test_memcg_current()
586 char *memcg; in test_memcg_high() local
589 memcg = cg_name(root, "memcg_test"); in test_memcg_high()
590 if (!memcg) in test_memcg_high()
593 if (cg_create(memcg)) in test_memcg_high()
596 if (cg_read_strcmp(memcg, "memory.high", "max\n")) in test_memcg_high()
599 if (cg_write(memcg, "memory.swap.max", "0")) in test_memcg_high()
602 if (cg_write(memcg, "memory.high", "30M")) in test_memcg_high()
605 if (cg_run(memcg, alloc_anon, (void *)MB(100))) in test_memcg_high()
608 if (!cg_run(memcg, alloc_pagecache_50M_check, NULL)) in test_memcg_high()
611 if (cg_run(memcg, alloc_pagecache_max_30M, NULL)) in test_memcg_high()
614 high = cg_read_key_long(memcg, "memory.events", "high "); in test_memcg_high()
621 cg_destroy(memcg); in test_memcg_high()
622 free(memcg); in test_memcg_high()
635 char *memcg; in test_memcg_max() local
638 memcg = cg_name(root, "memcg_test"); in test_memcg_max()
639 if (!memcg) in test_memcg_max()
642 if (cg_create(memcg)) in test_memcg_max()
645 if (cg_read_strcmp(memcg, "memory.max", "max\n")) in test_memcg_max()
648 if (cg_write(memcg, "memory.swap.max", "0")) in test_memcg_max()
651 if (cg_write(memcg, "memory.max", "30M")) in test_memcg_max()
655 if (!cg_run(memcg, alloc_anon, (void *)MB(100))) in test_memcg_max()
658 if (cg_run(memcg, alloc_pagecache_max_30M, NULL)) in test_memcg_max()
661 current = cg_read_long(memcg, "memory.current"); in test_memcg_max()
665 max = cg_read_key_long(memcg, "memory.events", "max "); in test_memcg_max()
672 cg_destroy(memcg); in test_memcg_max()
673 free(memcg); in test_memcg_max()
712 char *memcg; in test_memcg_swap_max() local
718 memcg = cg_name(root, "memcg_test"); in test_memcg_swap_max()
719 if (!memcg) in test_memcg_swap_max()
722 if (cg_create(memcg)) in test_memcg_swap_max()
725 if (cg_read_long(memcg, "memory.swap.current")) { in test_memcg_swap_max()
730 if (cg_read_strcmp(memcg, "memory.max", "max\n")) in test_memcg_swap_max()
733 if (cg_read_strcmp(memcg, "memory.swap.max", "max\n")) in test_memcg_swap_max()
736 if (cg_write(memcg, "memory.swap.max", "30M")) in test_memcg_swap_max()
739 if (cg_write(memcg, "memory.max", "30M")) in test_memcg_swap_max()
743 if (!cg_run(memcg, alloc_anon, (void *)MB(100))) in test_memcg_swap_max()
746 if (cg_read_key_long(memcg, "memory.events", "oom ") != 1) in test_memcg_swap_max()
749 if (cg_read_key_long(memcg, "memory.events", "oom_kill ") != 1) in test_memcg_swap_max()
752 if (cg_run(memcg, alloc_anon_50M_check_swap, (void *)MB(30))) in test_memcg_swap_max()
755 max = cg_read_key_long(memcg, "memory.events", "max "); in test_memcg_swap_max()
762 cg_destroy(memcg); in test_memcg_swap_max()
763 free(memcg); in test_memcg_swap_max()
776 char *memcg; in test_memcg_oom_events() local
778 memcg = cg_name(root, "memcg_test"); in test_memcg_oom_events()
779 if (!memcg) in test_memcg_oom_events()
782 if (cg_create(memcg)) in test_memcg_oom_events()
785 if (cg_write(memcg, "memory.max", "30M")) in test_memcg_oom_events()
788 if (cg_write(memcg, "memory.swap.max", "0")) in test_memcg_oom_events()
791 if (!cg_run(memcg, alloc_anon, (void *)MB(100))) in test_memcg_oom_events()
794 if (cg_read_strcmp(memcg, "cgroup.procs", "")) in test_memcg_oom_events()
797 if (cg_read_key_long(memcg, "memory.events", "oom ") != 1) in test_memcg_oom_events()
800 if (cg_read_key_long(memcg, "memory.events", "oom_kill ") != 1) in test_memcg_oom_events()
806 cg_destroy(memcg); in test_memcg_oom_events()
807 free(memcg); in test_memcg_oom_events()
937 char *memcg; in test_memcg_sock() local
939 memcg = cg_name(root, "memcg_test"); in test_memcg_sock()
940 if (!memcg) in test_memcg_sock()
943 if (cg_create(memcg)) in test_memcg_sock()
954 pid = cg_run_nowait(memcg, tcp_server, &args); in test_memcg_sock()
976 if (tcp_client(memcg, port) != KSFT_PASS) in test_memcg_sock()
983 if (cg_read_long(memcg, "memory.current") < 0) in test_memcg_sock()
986 if (cg_read_key_long(memcg, "memory.stat", "sock ")) in test_memcg_sock()
992 cg_destroy(memcg); in test_memcg_sock()
993 free(memcg); in test_memcg_sock()
1124 char *memcg; in test_memcg_oom_group_score_events() local
1127 memcg = cg_name(root, "memcg_test_0"); in test_memcg_oom_group_score_events()
1129 if (!memcg) in test_memcg_oom_group_score_events()
1132 if (cg_create(memcg)) in test_memcg_oom_group_score_events()
1135 if (cg_write(memcg, "memory.max", "50M")) in test_memcg_oom_group_score_events()
1138 if (cg_write(memcg, "memory.swap.max", "0")) in test_memcg_oom_group_score_events()
1141 if (cg_write(memcg, "memory.oom.group", "1")) in test_memcg_oom_group_score_events()
1144 safe_pid = cg_run_nowait(memcg, alloc_anon_noexit, (void *) MB(1)); in test_memcg_oom_group_score_events()
1148 cg_run_nowait(memcg, alloc_anon_noexit, (void *) MB(1)); in test_memcg_oom_group_score_events()
1149 if (!cg_run(memcg, alloc_anon, (void *)MB(100))) in test_memcg_oom_group_score_events()
1152 if (cg_read_key_long(memcg, "memory.events", "oom_kill ") != 3) in test_memcg_oom_group_score_events()
1161 if (memcg) in test_memcg_oom_group_score_events()
1162 cg_destroy(memcg); in test_memcg_oom_group_score_events()
1163 free(memcg); in test_memcg_oom_group_score_events()