public inbox for sched-ext@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 0/2] sched_ext: Update demo schedulers and selftests for deprecated APIs
@ 2026-03-12  4:19 Cheng-Yang Chou
  2026-03-12  4:20 ` [PATCH 1/2] sched_ext: Update demo schedulers and selftests to use scx_bpf_task_set_dsq_vtime() Cheng-Yang Chou
  2026-03-12  4:20 ` [PATCH 2/2] sched_ext: Update demo schedulers and selftests to drop ops.cpu_acquire/release() Cheng-Yang Chou
  0 siblings, 2 replies; 5+ messages in thread
From: Cheng-Yang Chou @ 2026-03-12  4:19 UTC (permalink / raw)
  To: sched-ext; +Cc: tj, void, arighi, changwoo, jserv, yphbchou0911

Two sets of sched_ext APIs have been deprecated:

- Direct writes to p->scx.dsq_vtime in favor of 
  scx_bpf_task_set_dsq_vtime()
- ops.cpu_acquire/release() in favor of handling CPU preemption via the
  sched_switch tracepoint

This series updates the demo schedulers (scx_simple, scx_flatcg,
scx_qmap) and selftests (select_cpu_vtime, maximal) to use the new
APIs, keeping them in sync with current best practices.

Patch 1 uses bpf_ksym_exists() to fall back to direct assignment on
older kernels that don't have scx_bpf_task_set_dsq_vtime(), preserving
backwards compatibility.

Patch 2 removes the cpu_acquire/release stubs and the
__COMPAT_scx_bpf_reenqueue_local_from_anywhere() compat guard from
scx_qmap, unconditionally relying on the sched_switch TP.

Thanks,
Cheng-Yang

---

Cheng-Yang Chou (2):
  sched_ext: Update demo schedulers and selftests to use
    scx_bpf_task_set_dsq_vtime()
  sched_ext: Update demo schedulers and selftests to drop
    ops.cpu_acquire/release()

 tools/sched_ext/scx_flatcg.bpf.c              | 21 ++++++++++++++-----
 tools/sched_ext/scx_qmap.bpf.c                | 15 ++-----------
 tools/sched_ext/scx_simple.bpf.c              | 12 +++++++++--
 .../testing/selftests/sched_ext/maximal.bpf.c | 15 ++++++-------
 .../sched_ext/select_cpu_vtime.bpf.c          | 13 ++++++++++--
 5 files changed, 45 insertions(+), 31 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-03-12  7:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12  4:19 [PATCH 0/2] sched_ext: Update demo schedulers and selftests for deprecated APIs Cheng-Yang Chou
2026-03-12  4:20 ` [PATCH 1/2] sched_ext: Update demo schedulers and selftests to use scx_bpf_task_set_dsq_vtime() Cheng-Yang Chou
2026-03-12  6:41   ` Andrea Righi
2026-03-12  4:20 ` [PATCH 2/2] sched_ext: Update demo schedulers and selftests to drop ops.cpu_acquire/release() Cheng-Yang Chou
2026-03-12  7:40   ` Andrea Righi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox