link = bpf_map__attach_struct_ops(skel->maps.init_enable_count_ops);
SCX_FAIL_IF(!link, "Failed to attach struct_ops");
/* SCHED_EXT children */ for (i = 0; i < num_children; i++) {
pids[i] = fork();
SCX_FAIL_IF(pids[i] < 0, "Failed to fork child");
if (pids[i] == 0) {
ret = sched_setscheduler(0, SCHED_EXT, ¶m);
SCX_BUG_ON(ret, "Failed to set sched to sched_ext");
/* *ResettoSCHED_OTHERforhalfofthem.Countsfor *everythingshouldstillbethesameregardless,as *ops.disable()isinvokedevenifataskisstillon *SCHED_EXTbeforeitexits.
*/ if (i % 2 == 0) {
ret = sched_setscheduler(0, SCHED_OTHER, ¶m);
SCX_BUG_ON(ret, "Failed to reset sched to normal");
} exit(0);
}
} for (i = 0; i < num_children; i++) {
SCX_FAIL_IF(waitpid(pids[i], &status, 0) != pids[i], "Failed to wait for SCX child\n");
SCX_FAIL_IF(status != 0, "SCX child %d exited with status %d\n", i,
status);
}
/* SCHED_OTHER children */ for (i = 0; i < num_children; i++) {
pids[i] = fork(); if (pids[i] == 0) exit(0);
}
for (i = 0; i < num_children; i++) {
SCX_FAIL_IF(waitpid(pids[i], &status, 0) != pids[i], "Failed to wait for normal child\n");
SCX_FAIL_IF(status != 0, "Normal child %d exited with status %d\n", i,
status);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.