[PATCH v2 0/2] sched_ext: Add a core event and update scx schedulers

Changwoo Min posted 2 patches 1 year ago
kernel/sched/ext.c                | 16 +++++++++++++++-
tools/sched_ext/scx_central.bpf.c |  2 ++
tools/sched_ext/scx_qmap.bpf.c    |  2 ++
3 files changed, 19 insertions(+), 1 deletion(-)
[PATCH v2 0/2] sched_ext: Add a core event and update scx schedulers
Posted by Changwoo Min 1 year ago
This patchset introduces a new event, SCX_EV_ENQ_SLICE_DFL, and updates
two scx schedulers -- scx_qmap and scx_central -- to print out the new
event.

SCX_EV_ENQ_SLICE_DFL counts how many times the tasks' time slice is set
to the default value (SCX_SLICE_DFL) by the sched_ext core in the enqueue
and pick_next paths.

Scheduling a task with SCX_SLICE_DFL unintentionally would be a source
of latency spikes because SCX_SLICE_DFL is relatively long (20 msec).
Thus, soaring the SCX_EV_ENQ_SLICE_DFL value would be a sign of BPF
scheduler bugs, causing latency spikes.

ChangeLog v1 -> v2:
  - Instrument the event at select_task_rq_scx() when ops.select_cpu()
    is not provided.

Changwoo Min (2):
  sched_ext: Add an event, SCX_EV_ENQ_SLICE_DFL
  sched_ext: Print an event, SCX_EV_ENQ_SLICE_DFL, in scx_qmap/central

 kernel/sched/ext.c                | 16 +++++++++++++++-
 tools/sched_ext/scx_central.bpf.c |  2 ++
 tools/sched_ext/scx_qmap.bpf.c    |  2 ++
 3 files changed, 19 insertions(+), 1 deletion(-)

-- 
2.48.1
Re: [PATCH v2 0/2] sched_ext: Add a core event and update scx schedulers
Posted by Tejun Heo 1 year ago
On Fri, Feb 07, 2025 at 03:40:50PM +0900, Changwoo Min wrote:
> This patchset introduces a new event, SCX_EV_ENQ_SLICE_DFL, and updates
> two scx schedulers -- scx_qmap and scx_central -- to print out the new
> event.
> 
> SCX_EV_ENQ_SLICE_DFL counts how many times the tasks' time slice is set
> to the default value (SCX_SLICE_DFL) by the sched_ext core in the enqueue
> and pick_next paths.
> 
> Scheduling a task with SCX_SLICE_DFL unintentionally would be a source
> of latency spikes because SCX_SLICE_DFL is relatively long (20 msec).
> Thus, soaring the SCX_EV_ENQ_SLICE_DFL value would be a sign of BPF
> scheduler bugs, causing latency spikes.

Applied to sched_ext/for-6.15.

Thanks.

-- 
tejun
Re: [PATCH v2 0/2] sched_ext: Add a core event and update scx schedulers
Posted by Andrea Righi 1 year ago
On Fri, Feb 07, 2025 at 03:40:50PM +0900, Changwoo Min wrote:
> This patchset introduces a new event, SCX_EV_ENQ_SLICE_DFL, and updates
> two scx schedulers -- scx_qmap and scx_central -- to print out the new
> event.
> 
> SCX_EV_ENQ_SLICE_DFL counts how many times the tasks' time slice is set
> to the default value (SCX_SLICE_DFL) by the sched_ext core in the enqueue
> and pick_next paths.
> 
> Scheduling a task with SCX_SLICE_DFL unintentionally would be a source
> of latency spikes because SCX_SLICE_DFL is relatively long (20 msec).
> Thus, soaring the SCX_EV_ENQ_SLICE_DFL value would be a sign of BPF
> scheduler bugs, causing latency spikes.

Looks good to me, thanks!

Acked-by: Andrea Righi <arighi@nvidia.com>

> 
> ChangeLog v1 -> v2:
>   - Instrument the event at select_task_rq_scx() when ops.select_cpu()
>     is not provided.
> 
> Changwoo Min (2):
>   sched_ext: Add an event, SCX_EV_ENQ_SLICE_DFL
>   sched_ext: Print an event, SCX_EV_ENQ_SLICE_DFL, in scx_qmap/central
> 
>  kernel/sched/ext.c                | 16 +++++++++++++++-
>  tools/sched_ext/scx_central.bpf.c |  2 ++
>  tools/sched_ext/scx_qmap.bpf.c    |  2 ++
>  3 files changed, 19 insertions(+), 1 deletion(-)
> 
> -- 
> 2.48.1
> 

-Andrea