Lines Matching defs:leaf
411 struct cpu_hogger leaf[3] = {NULL};
442 for (i = 0; i < ARRAY_SIZE(leaf); i++) {
453 leaf[i].cgroup = cg_name_indexed(ancestor, "cpucg_leaf", i);
454 if (!leaf[i].cgroup)
457 if (cg_create(leaf[i].cgroup))
460 if (cg_write_numeric(leaf[i].cgroup, "cpu.weight", weight))
464 for (i = 0; i < ARRAY_SIZE(leaf); i++) {
475 pid = cg_run_nowait(leaf[i].cgroup, hog_cpus_timed,
479 leaf[i].pid = pid;
482 for (i = 0; i < ARRAY_SIZE(leaf); i++) {
485 waitpid(leaf[i].pid, &retcode, 0);
492 for (i = 0; i < ARRAY_SIZE(leaf); i++) {
493 leaf[i].usage = cg_read_key_long(leaf[i].cgroup,
495 if (leaf[i].usage <= 0)
499 nested_leaf_usage = leaf[1].usage + leaf[2].usage;
501 if (!values_close(leaf[0].usage, nested_leaf_usage, 15))
503 } else if (!values_close(leaf[0].usage * 2, nested_leaf_usage, 15))
515 for (i = 0; i < ARRAY_SIZE(leaf); i++) {
516 cg_destroy(leaf[i].cgroup);
517 free(leaf[i].cgroup);
535 * A separate process is then created for each leaf, which spawn nproc threads
538 * Once all of those processes have exited, we verify that each of the leaf
555 * A separate process is then created for each leaf, which nproc / 4 threads
558 * Once all of those processes have exited, we verify that each of the leaf