Lines Matching +full:1 +full:mb
95 size_t size = MB(50); in alloc_anon_50M_check()
98 int ret = -1; in alloc_anon_50M_check()
103 return -1; in alloc_anon_50M_check()
131 size_t size = MB(50); in alloc_pagecache_50M_check()
132 int ret = -1; in alloc_pagecache_50M_check()
138 return -1; in alloc_pagecache_50M_check()
172 int peak_fd = -1, peak_fd2 = -1, peak_fd3 = -1, peak_fd4 = -1; in test_memcg_current_peak()
194 if (peak < MB(50)) in test_memcg_current_peak()
204 if (peak_fd == -1) { in test_memcg_current_peak()
225 if (peak_fd2 == -1) in test_memcg_current_peak()
230 if (peak_fd3 == -1) in test_memcg_current_peak()
250 if (peak < MB(50)) in test_memcg_current_peak()
259 if (peak_fd4 == -1) in test_memcg_current_peak()
267 if (peak > MB(30) || peak < 0) in test_memcg_current_peak()
274 if (peak < MB(50)) in test_memcg_current_peak()
279 if (peak < MB(50)) in test_memcg_current_peak()
283 if (peak < MB(50)) in test_memcg_current_peak()
315 if (alloc_pagecache(fd, MB(50))) in alloc_pagecache_50M_noexit()
316 return -1; in alloc_pagecache_50M_noexit()
319 sleep(1); in alloc_pagecache_50M_noexit()
333 return -1; in alloc_anon_noexit()
340 sleep(1); in alloc_anon_noexit()
360 return -1; in cg_test_proc_killed()
419 parent[1] = cg_name(parent[0], "memcg_test_1"); in test_memcg_protection()
420 if (!parent[1]) in test_memcg_protection()
446 if (cg_create(parent[1])) in test_memcg_protection()
449 if (cg_write(parent[1], "cgroup.subtree_control", "+memory")) in test_memcg_protection()
456 children[i] = cg_name_indexed(parent[1], "child_memcg", i); in test_memcg_protection()
470 if (cg_write(parent[1], attribute, "50M")) in test_memcg_protection()
474 if (cg_write(children[1], attribute, "25M")) in test_memcg_protection()
482 while (!values_close(cg_read_long(parent[1], "memory.current"), in test_memcg_protection()
483 MB(150), 3)) { in test_memcg_protection()
486 sleep(1); in test_memcg_protection()
489 if (cg_run(parent[2], alloc_anon, (void *)MB(148))) in test_memcg_protection()
492 if (!values_close(cg_read_long(parent[1], "memory.current"), MB(50), 3)) in test_memcg_protection()
498 if (!values_close(c[0], MB(29), 10)) in test_memcg_protection()
501 if (!values_close(c[1], MB(21), 10)) in test_memcg_protection()
507 rc = cg_run(parent[2], alloc_anon, (void *)MB(170)); in test_memcg_protection()
516 current = min ? MB(50) : MB(30); in test_memcg_protection()
517 if (!values_close(cg_read_long(parent[1], "memory.current"), current, 3)) in test_memcg_protection()
520 if (!reclaim_until(children[0], MB(10))) in test_memcg_protection()
529 int no_low_events_index = 1; in test_memcg_protection()
547 for (i = ARRAY_SIZE(children) - 1; i >= 0; i--) { in test_memcg_protection()
555 for (i = ARRAY_SIZE(parent) - 1; i >= 0; i--) { in test_memcg_protection()
578 size_t size = MB(50); in alloc_pagecache_max_30M()
579 int ret = -1; in alloc_pagecache_max_30M()
585 if (high != MB(30) && max != MB(30)) in alloc_pagecache_max_30M()
586 return -1; in alloc_pagecache_max_30M()
590 return -1; in alloc_pagecache_max_30M()
596 if (!values_close(current, MB(30), 5)) in alloc_pagecache_max_30M()
634 if (cg_run(memcg, alloc_anon, (void *)MB(31))) in test_memcg_high()
664 return -1; in alloc_anon_mlock()
677 int ret = KSFT_FAIL, pid, fd = -1; in test_memcg_high_sync()
707 pid = cg_run_nowait(memcg, alloc_anon_mlock, (void *)MB(200)); in test_memcg_high_sync()
760 if (!cg_run(memcg, alloc_anon, (void *)MB(100))) in test_memcg_max()
767 if (current > MB(30) || !current) in test_memcg_max()
832 int fd = -1; in test_memcg_reclaim()
859 cg_run_nowait(memcg, alloc_anon_noexit, (void *) MB(50)); in test_memcg_reclaim()
860 expected_usage = MB(100); in test_memcg_reclaim()
862 expected_usage = MB(50); in test_memcg_reclaim()
872 sleep(1); in test_memcg_reclaim()
886 if (!reclaim_until(memcg, MB(30))) in test_memcg_reclaim()
901 size_t size = MB(50); in alloc_anon_50M_check_swap()
904 int ret = -1; in alloc_anon_50M_check_swap()
909 return -1; in alloc_anon_50M_check_swap()
941 int swap_peak_fd = -1, mem_peak_fd = -1; in test_memcg_swap_max_peak()
964 if (swap_peak_fd == -1) { in test_memcg_swap_max_peak()
985 if (mem_peak_fd == -1) in test_memcg_swap_max_peak()
1029 if (!cg_run(memcg, alloc_anon, (void *)MB(100))) in test_memcg_swap_max_peak()
1032 if (cg_read_key_long(memcg, "memory.events", "oom ") != 1) in test_memcg_swap_max_peak()
1035 if (cg_read_key_long(memcg, "memory.events", "oom_kill ") != 1) in test_memcg_swap_max_peak()
1039 if (peak < MB(29)) in test_memcg_swap_max_peak()
1043 if (peak < MB(29)) in test_memcg_swap_max_peak()
1047 if (peak < MB(29)) in test_memcg_swap_max_peak()
1051 if (peak < MB(29)) in test_memcg_swap_max_peak()
1076 if (peak > MB(10)) in test_memcg_swap_max_peak()
1084 if (peak > MB(1)) in test_memcg_swap_max_peak()
1087 if (cg_read_long(memcg, "memory.peak") < MB(29)) in test_memcg_swap_max_peak()
1090 if (cg_read_long(memcg, "memory.swap.peak") < MB(29)) in test_memcg_swap_max_peak()
1093 if (cg_run(memcg, alloc_anon_50M_check_swap, (void *)MB(30))) in test_memcg_swap_max_peak()
1101 if (peak < MB(29)) in test_memcg_swap_max_peak()
1105 if (peak < MB(29)) in test_memcg_swap_max_peak()
1109 if (peak < MB(29)) in test_memcg_swap_max_peak()
1113 if (peak < MB(19)) in test_memcg_swap_max_peak()
1119 if (mem_peak_fd != -1 && close(mem_peak_fd)) in test_memcg_swap_max_peak()
1121 if (swap_peak_fd != -1 && close(swap_peak_fd)) in test_memcg_swap_max_peak()
1152 if (!cg_run(memcg, alloc_anon, (void *)MB(100))) in test_memcg_oom_events()
1158 if (cg_read_key_long(memcg, "memory.events", "oom ") != 1) in test_memcg_oom_events()
1161 if (cg_read_key_long(memcg, "memory.events", "oom_kill ") != 1) in test_memcg_oom_events()
1183 int sk, client_sk, ctl_fd, yes = 1, ret = -1; in tcp_server()
1186 ctl_fd = srv_args->ctl[1]; in tcp_server()
1204 if (listen(sk, 1)) in tcp_server()
1209 ret = -1; in tcp_server()
1217 ret = -1; in tcp_server()
1319 close(args.ctl[1]); in test_memcg_sock()
1392 if (cg_write(child, "memory.oom.group", "1")) in test_memcg_oom_group_leaf_events()
1395 cg_run_nowait(parent, alloc_anon_noexit, (void *) MB(60)); in test_memcg_oom_group_leaf_events()
1396 cg_run_nowait(child, alloc_anon_noexit, (void *) MB(1)); in test_memcg_oom_group_leaf_events()
1397 cg_run_nowait(child, alloc_anon_noexit, (void *) MB(1)); in test_memcg_oom_group_leaf_events()
1398 if (!cg_run(child, alloc_anon, (void *)MB(100))) in test_memcg_oom_group_leaf_events()
1460 if (cg_write(parent, "memory.oom.group", "1")) in test_memcg_oom_group_parent_events()
1463 cg_run_nowait(parent, alloc_anon_noexit, (void *) MB(60)); in test_memcg_oom_group_parent_events()
1464 cg_run_nowait(child, alloc_anon_noexit, (void *) MB(1)); in test_memcg_oom_group_parent_events()
1465 cg_run_nowait(child, alloc_anon_noexit, (void *) MB(1)); in test_memcg_oom_group_parent_events()
1467 if (!cg_run(child, alloc_anon, (void *)MB(100))) in test_memcg_oom_group_parent_events()
1513 if (cg_write(memcg, "memory.oom.group", "1")) in test_memcg_oom_group_score_events()
1516 safe_pid = cg_run_nowait(memcg, alloc_anon_noexit, (void *) MB(1)); in test_memcg_oom_group_score_events()
1520 cg_run_nowait(memcg, alloc_anon_noexit, (void *) MB(1)); in test_memcg_oom_group_score_events()
1521 if (!cg_run(memcg, alloc_anon, (void *)MB(100))) in test_memcg_oom_group_score_events()