Lines Matching refs:parent
29 char *parent, *child, *parent2 = NULL, *child2 = NULL; in test_memcg_subtree_control() local
34 parent = cg_name(root, "memcg_test_0"); in test_memcg_subtree_control()
36 if (!parent || !child) in test_memcg_subtree_control()
39 if (cg_create(parent)) in test_memcg_subtree_control()
42 if (cg_write(parent, "cgroup.subtree_control", "+memory")) in test_memcg_subtree_control()
81 cg_destroy(parent); in test_memcg_subtree_control()
83 free(parent); in test_memcg_subtree_control()
267 char *parent[3] = {NULL}; in test_memcg_min() local
277 parent[0] = cg_name(root, "memcg_test_0"); in test_memcg_min()
278 if (!parent[0]) in test_memcg_min()
281 parent[1] = cg_name(parent[0], "memcg_test_1"); in test_memcg_min()
282 if (!parent[1]) in test_memcg_min()
285 parent[2] = cg_name(parent[0], "memcg_test_2"); in test_memcg_min()
286 if (!parent[2]) in test_memcg_min()
289 if (cg_create(parent[0])) in test_memcg_min()
292 if (cg_read_long(parent[0], "memory.min")) { in test_memcg_min()
297 if (cg_write(parent[0], "cgroup.subtree_control", "+memory")) in test_memcg_min()
300 if (cg_write(parent[0], "memory.max", "200M")) in test_memcg_min()
303 if (cg_write(parent[0], "memory.swap.max", "0")) in test_memcg_min()
306 if (cg_create(parent[1])) in test_memcg_min()
309 if (cg_write(parent[1], "cgroup.subtree_control", "+memory")) in test_memcg_min()
312 if (cg_create(parent[2])) in test_memcg_min()
316 children[i] = cg_name_indexed(parent[1], "child_memcg", i); in test_memcg_min()
330 if (cg_write(parent[0], "memory.min", "50M")) in test_memcg_min()
332 if (cg_write(parent[1], "memory.min", "50M")) in test_memcg_min()
344 while (!values_close(cg_read_long(parent[1], "memory.current"), in test_memcg_min()
351 if (cg_run(parent[2], alloc_anon, (void *)MB(148))) in test_memcg_min()
354 if (!values_close(cg_read_long(parent[1], "memory.current"), MB(50), 3)) in test_memcg_min()
369 if (!cg_run(parent[2], alloc_anon, (void *)MB(170))) in test_memcg_min()
372 if (!values_close(cg_read_long(parent[1], "memory.current"), MB(50), 3)) in test_memcg_min()
386 for (i = ARRAY_SIZE(parent) - 1; i >= 0; i--) { in test_memcg_min()
387 if (!parent[i]) in test_memcg_min()
390 cg_destroy(parent[i]); in test_memcg_min()
391 free(parent[i]); in test_memcg_min()
423 char *parent[3] = {NULL}; in test_memcg_low() local
434 parent[0] = cg_name(root, "memcg_test_0"); in test_memcg_low()
435 if (!parent[0]) in test_memcg_low()
438 parent[1] = cg_name(parent[0], "memcg_test_1"); in test_memcg_low()
439 if (!parent[1]) in test_memcg_low()
442 parent[2] = cg_name(parent[0], "memcg_test_2"); in test_memcg_low()
443 if (!parent[2]) in test_memcg_low()
446 if (cg_create(parent[0])) in test_memcg_low()
449 if (cg_read_long(parent[0], "memory.low")) in test_memcg_low()
452 if (cg_write(parent[0], "cgroup.subtree_control", "+memory")) in test_memcg_low()
455 if (cg_write(parent[0], "memory.max", "200M")) in test_memcg_low()
458 if (cg_write(parent[0], "memory.swap.max", "0")) in test_memcg_low()
461 if (cg_create(parent[1])) in test_memcg_low()
464 if (cg_write(parent[1], "cgroup.subtree_control", "+memory")) in test_memcg_low()
467 if (cg_create(parent[2])) in test_memcg_low()
471 children[i] = cg_name_indexed(parent[1], "child_memcg", i); in test_memcg_low()
485 if (cg_write(parent[0], "memory.low", "50M")) in test_memcg_low()
487 if (cg_write(parent[1], "memory.low", "50M")) in test_memcg_low()
498 if (cg_run(parent[2], alloc_anon, (void *)MB(148))) in test_memcg_low()
501 if (!values_close(cg_read_long(parent[1], "memory.current"), MB(50), 3)) in test_memcg_low()
516 if (cg_run(parent[2], alloc_anon, (void *)MB(166))) { in test_memcg_low()
545 for (i = ARRAY_SIZE(parent) - 1; i >= 0; i--) { in test_memcg_low()
546 if (!parent[i]) in test_memcg_low()
549 cg_destroy(parent[i]); in test_memcg_low()
550 free(parent[i]); in test_memcg_low()
1010 char *parent, *child; in test_memcg_oom_group_leaf_events() local
1012 parent = cg_name(root, "memcg_test_0"); in test_memcg_oom_group_leaf_events()
1015 if (!parent || !child) in test_memcg_oom_group_leaf_events()
1018 if (cg_create(parent)) in test_memcg_oom_group_leaf_events()
1024 if (cg_write(parent, "cgroup.subtree_control", "+memory")) in test_memcg_oom_group_leaf_events()
1036 cg_run_nowait(parent, alloc_anon_noexit, (void *) MB(60)); in test_memcg_oom_group_leaf_events()
1048 if (cg_read_key_long(parent, "memory.events", "oom_kill ") != 0) in test_memcg_oom_group_leaf_events()
1056 if (parent) in test_memcg_oom_group_leaf_events()
1057 cg_destroy(parent); in test_memcg_oom_group_leaf_events()
1059 free(parent); in test_memcg_oom_group_leaf_events()
1072 char *parent, *child; in test_memcg_oom_group_parent_events() local
1074 parent = cg_name(root, "memcg_test_0"); in test_memcg_oom_group_parent_events()
1077 if (!parent || !child) in test_memcg_oom_group_parent_events()
1080 if (cg_create(parent)) in test_memcg_oom_group_parent_events()
1086 if (cg_write(parent, "memory.max", "80M")) in test_memcg_oom_group_parent_events()
1089 if (cg_write(parent, "memory.swap.max", "0")) in test_memcg_oom_group_parent_events()
1092 if (cg_write(parent, "memory.oom.group", "1")) in test_memcg_oom_group_parent_events()
1095 cg_run_nowait(parent, alloc_anon_noexit, (void *) MB(60)); in test_memcg_oom_group_parent_events()
1104 if (cg_test_proc_killed(parent)) in test_memcg_oom_group_parent_events()
1112 if (parent) in test_memcg_oom_group_parent_events()
1113 cg_destroy(parent); in test_memcg_oom_group_parent_events()
1115 free(parent); in test_memcg_oom_group_parent_events()