Lines Matching refs:leaf
411 struct cpu_hogger leaf[3] = {NULL}; in run_cpucg_nested_weight_test() local
442 for (i = 0; i < ARRAY_SIZE(leaf); i++) { in run_cpucg_nested_weight_test()
453 leaf[i].cgroup = cg_name_indexed(ancestor, "cpucg_leaf", i); in run_cpucg_nested_weight_test()
454 if (!leaf[i].cgroup) in run_cpucg_nested_weight_test()
457 if (cg_create(leaf[i].cgroup)) in run_cpucg_nested_weight_test()
460 if (cg_write_numeric(leaf[i].cgroup, "cpu.weight", weight)) in run_cpucg_nested_weight_test()
464 for (i = 0; i < ARRAY_SIZE(leaf); i++) { in run_cpucg_nested_weight_test()
475 pid = cg_run_nowait(leaf[i].cgroup, hog_cpus_timed, in run_cpucg_nested_weight_test()
479 leaf[i].pid = pid; in run_cpucg_nested_weight_test()
482 for (i = 0; i < ARRAY_SIZE(leaf); i++) { in run_cpucg_nested_weight_test()
485 waitpid(leaf[i].pid, &retcode, 0); in run_cpucg_nested_weight_test()
492 for (i = 0; i < ARRAY_SIZE(leaf); i++) { in run_cpucg_nested_weight_test()
493 leaf[i].usage = cg_read_key_long(leaf[i].cgroup, in run_cpucg_nested_weight_test()
495 if (leaf[i].usage <= 0) in run_cpucg_nested_weight_test()
499 nested_leaf_usage = leaf[1].usage + leaf[2].usage; in run_cpucg_nested_weight_test()
501 if (!values_close(leaf[0].usage, nested_leaf_usage, 15)) in run_cpucg_nested_weight_test()
503 } else if (!values_close(leaf[0].usage * 2, nested_leaf_usage, 15)) in run_cpucg_nested_weight_test()
515 for (i = 0; i < ARRAY_SIZE(leaf); i++) { in run_cpucg_nested_weight_test()
516 cg_destroy(leaf[i].cgroup); in run_cpucg_nested_weight_test()
517 free(leaf[i].cgroup); in run_cpucg_nested_weight_test()