Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

scx: Sync from the SCX repo #206

Merged
merged 1 commit into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tools/sched_ext/include/scx/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ static inline long scx_hotplug_seq(void)
SCX_BUG_ON(__scx_name##__load((__skel)), "Failed to load skel"); \
})

#define SCX_OPS_ATTACH(__skel, __ops_name) ({ \
#define SCX_OPS_ATTACH(__skel, __ops_name, __scx_name) ({ \
struct bpf_link *__link; \
SCX_BUG_ON(__scx_name##__attach((__skel)), "Failed to attach skel"); \
__link = bpf_map__attach_struct_ops((__skel)->maps.__ops_name); \
SCX_BUG_ON(!__link, "Failed to attach struct_ops"); \
__link; \
Expand Down
2 changes: 1 addition & 1 deletion tools/sched_ext/scx_central.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ int main(int argc, char **argv)
skel->rodata->central_cpu, skel->rodata->nr_cpu_ids - 1);
CPU_FREE(cpuset);

link = SCX_OPS_ATTACH(skel, central_ops);
link = SCX_OPS_ATTACH(skel, central_ops, scx_central);

if (!skel->data->timer_pinned)
printf("WARNING : BPF_F_TIMER_CPU_PIN not available, timer not pinned to central\n");
Expand Down
2 changes: 1 addition & 1 deletion tools/sched_ext/scx_flatcg.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ int main(int argc, char **argv)
dump_cgrps);

SCX_OPS_LOAD(skel, flatcg_ops, scx_flatcg, uei);
link = SCX_OPS_ATTACH(skel, flatcg_ops);
link = SCX_OPS_ATTACH(skel, flatcg_ops, scx_flatcg);

while (!exit_req && !UEI_EXITED(skel, uei)) {
__u64 acc_stats[FCG_NR_STATS];
Expand Down
2 changes: 1 addition & 1 deletion tools/sched_ext/scx_qmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int main(int argc, char **argv)
fprintf(stderr, "kernel doesn't support DSQ iteration\n");

SCX_OPS_LOAD(skel, qmap_ops, scx_qmap, uei);
link = SCX_OPS_ATTACH(skel, qmap_ops);
link = SCX_OPS_ATTACH(skel, qmap_ops, scx_qmap);

while (!exit_req && !UEI_EXITED(skel, uei)) {
long nr_enqueued = skel->bss->nr_enqueued;
Expand Down
2 changes: 1 addition & 1 deletion tools/sched_ext/scx_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int main(int argc, char **argv)
}

SCX_OPS_LOAD(skel, simple_ops, scx_simple, uei);
link = SCX_OPS_ATTACH(skel, simple_ops);
link = SCX_OPS_ATTACH(skel, simple_ops, scx_simple);

while (!exit_req && !UEI_EXITED(skel, uei)) {
__u64 stats[2];
Expand Down