Lines Matching +full:parent +full:- +full:child

1 /* SPDX-License-Identifier: GPL-2.0 */
34 return -1; in cg_check_frozen()
42 return -1; in cg_check_frozen()
62 int fd, ret = -1; in cg_prepare_for_wait()
65 if (fd == -1) { in cg_prepare_for_wait()
72 if (ret == -1) { in cg_prepare_for_wait()
75 fd = -1; in cg_prepare_for_wait()
87 int ret = -1; in cg_wait_for()
96 if (ret == -1) { in cg_wait_for()
119 int fd, ret = -1; in cg_enter_and_wait_for_frozen()
152 int fd, ret = -1; in cg_freeze_wait()
176 * re-parented.
302 * Wait until all child processes will enter in test_cgfreezer_tree()
386 for (i = 9; i >= 0 && cgroup[i]; i--) { in test_cgfreezer_tree()
452 * The test creates a cgroups and freezes it. Then it creates a child cgroup
453 * and populates it with a task. After that it checks that the child cgroup
454 * is frozen and the parent cgroup remains frozen too.
459 char *parent, *child = NULL; in test_cgfreezer_mkdir() local
462 parent = cg_name(root, "cg_test_mkdir_A"); in test_cgfreezer_mkdir()
463 if (!parent) in test_cgfreezer_mkdir()
466 child = cg_name(parent, "cg_test_mkdir_B"); in test_cgfreezer_mkdir()
467 if (!child) in test_cgfreezer_mkdir()
470 if (cg_create(parent)) in test_cgfreezer_mkdir()
473 if (cg_freeze_wait(parent, true)) in test_cgfreezer_mkdir()
476 if (cg_create(child)) in test_cgfreezer_mkdir()
479 pid = cg_run_nowait(child, child_fn, NULL); in test_cgfreezer_mkdir()
483 if (cg_wait_for_proc_count(child, 1)) in test_cgfreezer_mkdir()
486 if (cg_check_frozen(child, true)) in test_cgfreezer_mkdir()
489 if (cg_check_frozen(parent, true)) in test_cgfreezer_mkdir()
495 if (child) in test_cgfreezer_mkdir()
496 cg_destroy(child); in test_cgfreezer_mkdir()
497 free(child); in test_cgfreezer_mkdir()
498 if (parent) in test_cgfreezer_mkdir()
499 cg_destroy(parent); in test_cgfreezer_mkdir()
500 free(parent); in test_cgfreezer_mkdir()
505 * The test creates two nested cgroups, freezes the parent
506 * and removes the child. Then it checks that the parent cgroup
507 * remains frozen and it's possible to create a new child
508 * without unfreezing. The new child is frozen too.
513 char *parent, *child = NULL; in test_cgfreezer_rmdir() local
515 parent = cg_name(root, "cg_test_rmdir_A"); in test_cgfreezer_rmdir()
516 if (!parent) in test_cgfreezer_rmdir()
519 child = cg_name(parent, "cg_test_rmdir_B"); in test_cgfreezer_rmdir()
520 if (!child) in test_cgfreezer_rmdir()
523 if (cg_create(parent)) in test_cgfreezer_rmdir()
526 if (cg_create(child)) in test_cgfreezer_rmdir()
529 if (cg_freeze_wait(parent, true)) in test_cgfreezer_rmdir()
532 if (cg_destroy(child)) in test_cgfreezer_rmdir()
535 if (cg_check_frozen(parent, true)) in test_cgfreezer_rmdir()
538 if (cg_create(child)) in test_cgfreezer_rmdir()
541 if (cg_check_frozen(child, true)) in test_cgfreezer_rmdir()
547 if (child) in test_cgfreezer_rmdir()
548 cg_destroy(child); in test_cgfreezer_rmdir()
549 free(child); in test_cgfreezer_rmdir()
550 if (parent) in test_cgfreezer_rmdir()
551 cg_destroy(parent); in test_cgfreezer_rmdir()
552 free(parent); in test_cgfreezer_rmdir()
559 * 1) A (running) -> B (frozen)
560 * 2) B (frozen) -> A (running)
561 * 3) A (frozen) -> B (frozen)
706 if (len == -1) { in proc_check_stopped()
708 return -1; in proc_check_stopped()
713 return -1; in proc_check_stopped()
833 * which called vfork() and is waiting for a child.