Lines Matching +full:max +full:- +full:retries
1 /* SPDX-License-Identifier: GPL-2.0 */
98 int ret = -1; in alloc_anon_50M_check()
103 return -1; in alloc_anon_50M_check()
132 int ret = -1; in alloc_pagecache_50M_check()
138 return -1; in alloc_pagecache_50M_check()
204 return -1; in alloc_pagecache_50M_noexit()
221 return -1; in alloc_anon_noexit()
242 for (limit = 10; limit > 0; limit--) { in cg_test_proc_killed()
248 return -1; in cg_test_proc_killed()
255 * A memory.min = 0, memory.max = 200M
328 if (cg_write(parent[0], "memory.max", "200M")) in test_memcg_protection()
331 if (cg_write(parent[0], "memory.swap.max", "0")) in test_memcg_protection()
435 for (i = ARRAY_SIZE(children) - 1; i >= 0; i--) { in test_memcg_protection()
443 for (i = ARRAY_SIZE(parent) - 1; i >= 0; i--) { in test_memcg_protection()
467 int ret = -1; in alloc_pagecache_max_30M()
468 long current, high, max; in alloc_pagecache_max_30M() local
472 max = cg_read_long(cgroup, "memory.max"); in alloc_pagecache_max_30M()
473 if (high != MB(30) && max != MB(30)) in alloc_pagecache_max_30M()
474 return -1; in alloc_pagecache_max_30M()
478 return -1; in alloc_pagecache_max_30M()
513 if (cg_read_strcmp(memcg, "memory.high", "max\n")) in test_memcg_high()
516 if (cg_write(memcg, "memory.swap.max", "0")) in test_memcg_high()
552 return -1; in alloc_anon_mlock()
565 int ret = KSFT_FAIL, pid, fd = -1; in test_memcg_high_sync()
578 pre_max = cg_read_key_long(memcg, "memory.events", "max "); in test_memcg_high_sync()
582 if (cg_write(memcg, "memory.swap.max", "0")) in test_memcg_high_sync()
588 if (cg_write(memcg, "memory.max", "140M")) in test_memcg_high_sync()
602 post_max = cg_read_key_long(memcg, "memory.events", "max "); in test_memcg_high_sync()
621 * This test checks that memory.max limits the amount of
629 long current, max; in test_memcg_max() local
638 if (cg_read_strcmp(memcg, "memory.max", "max\n")) in test_memcg_max()
641 if (cg_write(memcg, "memory.swap.max", "0")) in test_memcg_max()
644 if (cg_write(memcg, "memory.max", "30M")) in test_memcg_max()
658 max = cg_read_key_long(memcg, "memory.events", "max "); in test_memcg_max()
659 if (max <= 0) in test_memcg_max()
689 int retries, err; in reclaim_until() local
693 for (retries = 5; retries > 0; retries--) { in reclaim_until()
702 to_reclaim = current - goal; in reclaim_until()
707 else if (err != -EAGAIN) in reclaim_until()
719 int ret = KSFT_FAIL, fd, retries; in test_memcg_reclaim() local
752 * retries). in test_memcg_reclaim()
754 retries = 5; in test_memcg_reclaim()
757 if (retries--) { in test_memcg_reclaim()
790 int ret = -1; in alloc_anon_50M_check_swap()
795 return -1; in alloc_anon_50M_check_swap()
817 * This test checks that memory.swap.max limits the amount of
824 long max; in test_memcg_swap_max() local
841 if (cg_read_strcmp(memcg, "memory.max", "max\n")) in test_memcg_swap_max()
844 if (cg_read_strcmp(memcg, "memory.swap.max", "max\n")) in test_memcg_swap_max()
847 if (cg_write(memcg, "memory.swap.max", "30M")) in test_memcg_swap_max()
850 if (cg_write(memcg, "memory.max", "30M")) in test_memcg_swap_max()
866 max = cg_read_key_long(memcg, "memory.events", "max "); in test_memcg_swap_max()
867 if (max <= 0) in test_memcg_swap_max()
896 if (cg_write(memcg, "memory.max", "30M")) in test_memcg_oom_events()
899 if (cg_write(memcg, "memory.swap.max", "0")) in test_memcg_oom_events()
933 int sk, client_sk, ctl_fd, yes = 1, ret = -1; in tcp_server()
935 close(srv_args->ctl[0]); in tcp_server()
936 ctl_fd = srv_args->ctl[1]; in tcp_server()
940 saddr.sin6_port = htons(srv_args->port); in tcp_server()
959 ret = -1; in tcp_server()
967 ret = -1; in tcp_server()
990 int retries = 0x10; /* nice round number */ in tcp_client() local
1000 sk = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); in tcp_client()
1004 ret = connect(sk, ai->ai_addr, ai->ai_addrlen); in tcp_client()
1009 while (retries--) { in tcp_client()
1023 if (values_close(current - allocated, sock, 10)) { in tcp_client()
1057 while (bind_retries--) { in test_memcg_sock()
1136 if (cg_write(child, "memory.max", "50M")) in test_memcg_oom_group_leaf_events()
1139 if (cg_write(child, "memory.swap.max", "0")) in test_memcg_oom_group_leaf_events()
1204 if (cg_write(parent, "memory.max", "80M")) in test_memcg_oom_group_parent_events()
1207 if (cg_write(parent, "memory.swap.max", "0")) in test_memcg_oom_group_parent_events()
1257 if (cg_write(memcg, "memory.max", "50M")) in test_memcg_oom_group_score_events()
1260 if (cg_write(memcg, "memory.swap.max", "0")) in test_memcg_oom_group_score_events()