[PATCH 0/7] sched_ext: Implement core event counters

From: Changwoo Min
Date: Thu Jan 16 2025 - 10:16:20 EST


The sched_ext core often has to override the BPF scheduler decisions,
and some events could be interesting but not easily visible.

This patchset aims to address such a problem in the following manner:
- Introduce an infrastructure to collect such events in a scalable and
extensible way and to expose the collected events to the BPF scheduler
in a compatible way.
- Define five events to be collected.
- Modify an scx scheduler to demonstrate the usage of the new BPF APIs.

Changwoo Min (7):
sched_ext: Implement event counter infrastructure and add an event
sched_ext: Add an event, SCX_EVENT_OFFLINE_LOCAL_DSQ
sched_ext: Add an event, SCX_EVENT_CNTD_RUN_WO_ENQ
sched_ext: Add an event, SCX_EVENT_ENQ_LOCAL_EXITING
sched_ext: Add an event, SCX_EVENT_RQ_BYPASSING_OPS
sched_ext: Add scx_bpf_event_stat() and scx_read_event() for BPF
schedulers
sched_ext: Print core event count in scx_central scheduler

kernel/sched/ext.c | 173 ++++++++++++++++++++++-
tools/sched_ext/include/scx/common.bpf.h | 4 +
tools/sched_ext/scx_central.bpf.c | 18 +++
3 files changed, 190 insertions(+), 5 deletions(-)

--
2.48.1