Lines Matching refs:parent

29 	char *parent, *child, *parent2, *child2;  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()
73 cg_destroy(parent); in test_memcg_subtree_control()
74 free(parent); in test_memcg_subtree_control()
263 char *parent[3] = {NULL}; in test_memcg_min() local
273 parent[0] = cg_name(root, "memcg_test_0"); in test_memcg_min()
274 if (!parent[0]) in test_memcg_min()
277 parent[1] = cg_name(parent[0], "memcg_test_1"); in test_memcg_min()
278 if (!parent[1]) in test_memcg_min()
281 parent[2] = cg_name(parent[0], "memcg_test_2"); in test_memcg_min()
282 if (!parent[2]) in test_memcg_min()
285 if (cg_create(parent[0])) in test_memcg_min()
288 if (cg_read_long(parent[0], "memory.min")) { in test_memcg_min()
293 if (cg_write(parent[0], "cgroup.subtree_control", "+memory")) in test_memcg_min()
296 if (cg_write(parent[0], "memory.max", "200M")) in test_memcg_min()
299 if (cg_write(parent[0], "memory.swap.max", "0")) in test_memcg_min()
302 if (cg_create(parent[1])) in test_memcg_min()
305 if (cg_write(parent[1], "cgroup.subtree_control", "+memory")) in test_memcg_min()
308 if (cg_create(parent[2])) in test_memcg_min()
312 children[i] = cg_name_indexed(parent[1], "child_memcg", i); in test_memcg_min()
326 if (cg_write(parent[0], "memory.min", "50M")) in test_memcg_min()
328 if (cg_write(parent[1], "memory.min", "50M")) in test_memcg_min()
340 while (!values_close(cg_read_long(parent[1], "memory.current"), in test_memcg_min()
347 if (cg_run(parent[2], alloc_anon, (void *)MB(148))) in test_memcg_min()
350 if (!values_close(cg_read_long(parent[1], "memory.current"), MB(50), 3)) in test_memcg_min()
365 if (!cg_run(parent[2], alloc_anon, (void *)MB(170))) in test_memcg_min()
368 if (!values_close(cg_read_long(parent[1], "memory.current"), MB(50), 3)) in test_memcg_min()
382 for (i = ARRAY_SIZE(parent) - 1; i >= 0; i--) { in test_memcg_min()
383 if (!parent[i]) in test_memcg_min()
386 cg_destroy(parent[i]); in test_memcg_min()
387 free(parent[i]); in test_memcg_min()
419 char *parent[3] = {NULL}; in test_memcg_low() local
430 parent[0] = cg_name(root, "memcg_test_0"); in test_memcg_low()
431 if (!parent[0]) in test_memcg_low()
434 parent[1] = cg_name(parent[0], "memcg_test_1"); in test_memcg_low()
435 if (!parent[1]) in test_memcg_low()
438 parent[2] = cg_name(parent[0], "memcg_test_2"); in test_memcg_low()
439 if (!parent[2]) in test_memcg_low()
442 if (cg_create(parent[0])) in test_memcg_low()
445 if (cg_read_long(parent[0], "memory.low")) in test_memcg_low()
448 if (cg_write(parent[0], "cgroup.subtree_control", "+memory")) in test_memcg_low()
451 if (cg_write(parent[0], "memory.max", "200M")) in test_memcg_low()
454 if (cg_write(parent[0], "memory.swap.max", "0")) in test_memcg_low()
457 if (cg_create(parent[1])) in test_memcg_low()
460 if (cg_write(parent[1], "cgroup.subtree_control", "+memory")) in test_memcg_low()
463 if (cg_create(parent[2])) in test_memcg_low()
467 children[i] = cg_name_indexed(parent[1], "child_memcg", i); in test_memcg_low()
481 if (cg_write(parent[0], "memory.low", "50M")) in test_memcg_low()
483 if (cg_write(parent[1], "memory.low", "50M")) in test_memcg_low()
494 if (cg_run(parent[2], alloc_anon, (void *)MB(148))) in test_memcg_low()
497 if (!values_close(cg_read_long(parent[1], "memory.current"), MB(50), 3)) in test_memcg_low()
512 if (cg_run(parent[2], alloc_anon, (void *)MB(166))) { in test_memcg_low()
541 for (i = ARRAY_SIZE(parent) - 1; i >= 0; i--) { in test_memcg_low()
542 if (!parent[i]) in test_memcg_low()
545 cg_destroy(parent[i]); in test_memcg_low()
546 free(parent[i]); in test_memcg_low()
1006 char *parent, *child; in test_memcg_oom_group_leaf_events() local
1008 parent = cg_name(root, "memcg_test_0"); in test_memcg_oom_group_leaf_events()
1011 if (!parent || !child) in test_memcg_oom_group_leaf_events()
1014 if (cg_create(parent)) in test_memcg_oom_group_leaf_events()
1020 if (cg_write(parent, "cgroup.subtree_control", "+memory")) in test_memcg_oom_group_leaf_events()
1032 cg_run_nowait(parent, alloc_anon_noexit, (void *) MB(60)); in test_memcg_oom_group_leaf_events()
1044 if (cg_read_key_long(parent, "memory.events", "oom_kill ") != 0) in test_memcg_oom_group_leaf_events()
1052 if (parent) in test_memcg_oom_group_leaf_events()
1053 cg_destroy(parent); in test_memcg_oom_group_leaf_events()
1055 free(parent); in test_memcg_oom_group_leaf_events()
1068 char *parent, *child; in test_memcg_oom_group_parent_events() local
1070 parent = cg_name(root, "memcg_test_0"); in test_memcg_oom_group_parent_events()
1073 if (!parent || !child) in test_memcg_oom_group_parent_events()
1076 if (cg_create(parent)) in test_memcg_oom_group_parent_events()
1082 if (cg_write(parent, "memory.max", "80M")) in test_memcg_oom_group_parent_events()
1085 if (cg_write(parent, "memory.swap.max", "0")) in test_memcg_oom_group_parent_events()
1088 if (cg_write(parent, "memory.oom.group", "1")) in test_memcg_oom_group_parent_events()
1091 cg_run_nowait(parent, alloc_anon_noexit, (void *) MB(60)); in test_memcg_oom_group_parent_events()
1100 if (cg_test_proc_killed(parent)) in test_memcg_oom_group_parent_events()
1108 if (parent) in test_memcg_oom_group_parent_events()
1109 cg_destroy(parent); in test_memcg_oom_group_parent_events()
1111 free(parent); in test_memcg_oom_group_parent_events()