All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] sched_ext: Update demo schedulers and selftests for deprecated APIs
@ 2026-03-13  1:49 Cheng-Yang Chou
  2026-03-13  1:49 ` [PATCH v3 1/2] sched_ext: Update demo schedulers and selftests to use scx_bpf_task_set_dsq_vtime() Cheng-Yang Chou
  2026-03-13  1:49 ` [PATCH v3 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-13  1:49 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, as introduced by commit a3f5d4822253
  ("sched_ext: Allow scx_bpf_reenqueue_local() to be called from
  anywhere")

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 updates scx_simple, scx_flatcg, and select_cpu_vtime to use
scx_bpf_task_set_dsq_vtime() with scale_by_task_weight_inverse().

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. The maximal
selftest and reload_loop test are also fixed to properly attach the
sched_switch tracepoint via bpf_map__set_autoattach() and
maximal__attach(), as both tests use the maximal skeleton.

Changes in v3:
- Use scale_by_task_weight_inverse() instead of scale_by_task_weight()
  (Andrea Righi)
- Link to v2:
  https://lore.kernel.org/all/20260312175527.1220540-1-yphbchou0911@gmail.com/

Changes in v2:
- Use scx_bpf_task_set_dsq_vtime() with scale_by_task_weight instead
  of direct assignment and remove redundant bpf_ksym_exists() logic
  (Andrea Righi)
- Mention commit a3f5d4822253 ("sched_ext: Allow
  scx_bpf_reenqueue_local() to be called from anywhere") in the commit
  message to clarify why ops.cpu_acquire/release() are being deprecated
  (Andrea Righi)
- Fix maximal.c and reload_loop.c to actually attach the sched_switch
  tracepoint by calling bpf_map__set_autoattach() and maximal__attach()
  (Andrea Righi)
- Link to v1:
  https://lore.kernel.org/all/20260312042001.955675-1-yphbchou0911@gmail.com/

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                  |  9 +++++----
 tools/sched_ext/scx_qmap.bpf.c                    | 15 ++-------------
 tools/sched_ext/scx_simple.bpf.c                  |  6 ++++--
 tools/testing/selftests/sched_ext/maximal.bpf.c   | 15 ++++++---------
 tools/testing/selftests/sched_ext/maximal.c       |  3 +++
 tools/testing/selftests/sched_ext/reload_loop.c   |  3 +++
 .../selftests/sched_ext/select_cpu_vtime.bpf.c    |  7 +++++--
 7 files changed, 28 insertions(+), 30 deletions(-)

-- 
2.48.1


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

end of thread, other threads:[~2026-03-14  2:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-13  1:49 [PATCH v3 0/2] sched_ext: Update demo schedulers and selftests for deprecated APIs Cheng-Yang Chou
2026-03-13  1:49 ` [PATCH v3 1/2] sched_ext: Update demo schedulers and selftests to use scx_bpf_task_set_dsq_vtime() Cheng-Yang Chou
2026-03-13 16:56   ` Tejun Heo
2026-03-14  2:50     ` Cheng-Yang Chou
2026-03-13  1:49 ` [PATCH v3 2/2] sched_ext: Update demo schedulers and selftests to drop ops.cpu_acquire/release() Cheng-Yang Chou

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.