Lines Matching refs:parent

111 	char *parent, *child, *parent2 = NULL, *child2 = NULL;  in test_memcg_subtree_control()  local
116 parent = cg_name(root, "memcg_test_0"); in test_memcg_subtree_control()
118 if (!parent || !child) in test_memcg_subtree_control()
121 if (cg_create(parent)) in test_memcg_subtree_control()
124 if (cg_write(parent, "cgroup.subtree_control", "+memory")) in test_memcg_subtree_control()
163 cg_destroy(parent); in test_memcg_subtree_control()
165 free(parent); in test_memcg_subtree_control()
482 char *parent[3] = {NULL}; in test_memcg_protection() local
494 parent[0] = cg_name(root, "memcg_test_0"); in test_memcg_protection()
495 if (!parent[0]) in test_memcg_protection()
498 parent[1] = cg_name(parent[0], "memcg_test_1"); in test_memcg_protection()
499 if (!parent[1]) in test_memcg_protection()
502 parent[2] = cg_name(parent[0], "memcg_test_2"); in test_memcg_protection()
503 if (!parent[2]) in test_memcg_protection()
506 if (cg_create(parent[0])) in test_memcg_protection()
509 if (cg_read_long(parent[0], attribute)) { in test_memcg_protection()
516 if (cg_write(parent[0], "cgroup.subtree_control", "+memory")) in test_memcg_protection()
519 if (cg_write(parent[0], "memory.max", "200M")) in test_memcg_protection()
522 if (cg_write(parent[0], "memory.swap.max", "0")) in test_memcg_protection()
525 if (cg_create(parent[1])) in test_memcg_protection()
528 if (cg_write(parent[1], "cgroup.subtree_control", "+memory")) in test_memcg_protection()
531 if (cg_create(parent[2])) in test_memcg_protection()
535 children[i] = cg_name_indexed(parent[1], "child_memcg", i); in test_memcg_protection()
549 if (cg_write(parent[1], attribute, "50M")) in test_memcg_protection()
561 while (!values_close(cg_read_long(parent[1], "memory.current"), in test_memcg_protection()
568 if (cg_run(parent[2], alloc_anon, (void *)MB(148))) in test_memcg_protection()
571 if (!values_close(cg_read_long(parent[1], "memory.current"), MB(50), 3)) in test_memcg_protection()
586 rc = cg_run(parent[2], alloc_anon, (void *)MB(170)); in test_memcg_protection()
596 if (!values_close(cg_read_long(parent[1], "memory.current"), current, 3)) in test_memcg_protection()
643 for (i = ARRAY_SIZE(parent) - 1; i >= 0; i--) { in test_memcg_protection()
644 if (!parent[i]) in test_memcg_protection()
647 cg_destroy(parent[i]); in test_memcg_protection()
648 free(parent[i]); in test_memcg_protection()
1456 char *parent, *child; in test_memcg_oom_group_leaf_events() local
1459 parent = cg_name(root, "memcg_test_0"); in test_memcg_oom_group_leaf_events()
1462 if (!parent || !child) in test_memcg_oom_group_leaf_events()
1465 if (cg_create(parent)) in test_memcg_oom_group_leaf_events()
1471 if (cg_write(parent, "cgroup.subtree_control", "+memory")) in test_memcg_oom_group_leaf_events()
1483 cg_run_nowait(parent, alloc_anon_noexit, (void *) MB(60)); in test_memcg_oom_group_leaf_events()
1496 parent, "memory.events", "oom_kill "); in test_memcg_oom_group_leaf_events()
1512 if (parent) in test_memcg_oom_group_leaf_events()
1513 cg_destroy(parent); in test_memcg_oom_group_leaf_events()
1515 free(parent); in test_memcg_oom_group_leaf_events()
1528 char *parent, *child; in test_memcg_oom_group_parent_events() local
1530 parent = cg_name(root, "memcg_test_0"); in test_memcg_oom_group_parent_events()
1533 if (!parent || !child) in test_memcg_oom_group_parent_events()
1536 if (cg_create(parent)) in test_memcg_oom_group_parent_events()
1542 if (cg_write(parent, "memory.max", "80M")) in test_memcg_oom_group_parent_events()
1545 if (cg_write(parent, "memory.swap.max", "0")) in test_memcg_oom_group_parent_events()
1548 if (cg_write(parent, "memory.oom.group", "1")) in test_memcg_oom_group_parent_events()
1551 cg_run_nowait(parent, alloc_anon_noexit, (void *) MB(60)); in test_memcg_oom_group_parent_events()
1560 if (cg_test_proc_killed(parent)) in test_memcg_oom_group_parent_events()
1568 if (parent) in test_memcg_oom_group_parent_events()
1569 cg_destroy(parent); in test_memcg_oom_group_parent_events()
1571 free(parent); in test_memcg_oom_group_parent_events()