Skip to content

Commit 68adaa9

Browse files
committed
sched_ext: Drop kfuncs marked for removal in 6.15
JIRA: https://issues.redhat.com/browse/RHEL-111810 commit 4ecf837 Author: Jake Hillion <jake@hillion.co.uk> Date: Wed Jun 25 18:05:46 2025 +0100 sched_ext: Drop kfuncs marked for removal in 6.15 sched_ext performed a kfunc renaming pass in 6.13 and kept the old names around for compatibility with old binaries. These were scheduled for cleanup in 6.15 but were missed. Submitting for cleanup in for-next. Removed the kfuncs, their flags, and any references I could find to them in doc comments. Left the entries in include/scx/compat.bpf.h as they're still useful to make new binaries compatible with old kernels. Tested by applying to my kernel. It builds and a modern version of scx_lavd loads fine. Signed-off-by: Jake Hillion <jake@hillion.co.uk> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Phil Auld <pauld@redhat.com>
1 parent 2c11471 commit 68adaa9

File tree

2 files changed

+7
-74
lines changed

2 files changed

+7
-74
lines changed

include/linux/sched/ext.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ struct sched_ext_entity {
164164

165165
/*
166166
* Runtime budget in nsecs. This is usually set through
167-
* scx_bpf_dispatch() but can also be modified directly by the BPF
167+
* scx_bpf_dsq_insert() but can also be modified directly by the BPF
168168
* scheduler. Automatically decreased by SCX as the task executes. On
169169
* depletion, a scheduling event is triggered.
170170
*
@@ -176,10 +176,10 @@ struct sched_ext_entity {
176176

177177
/*
178178
* Used to order tasks when dispatching to the vtime-ordered priority
179-
* queue of a dsq. This is usually set through scx_bpf_dispatch_vtime()
180-
* but can also be modified directly by the BPF scheduler. Modifying it
181-
* while a task is queued on a dsq may mangle the ordering and is not
182-
* recommended.
179+
* queue of a dsq. This is usually set through
180+
* scx_bpf_dsq_insert_vtime() but can also be modified directly by the
181+
* BPF scheduler. Modifying it while a task is queued on a dsq may
182+
* mangle the ordering and is not recommended.
183183
*/
184184
u64 dsq_vtime;
185185

kernel/sched/ext.c

Lines changed: 2 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -6344,7 +6344,8 @@ __bpf_kfunc_start_defs();
63446344
* When called from ops.dispatch(), there are no restrictions on @p or @dsq_id
63456345
* and this function can be called upto ops.dispatch_max_batch times to insert
63466346
* multiple tasks. scx_bpf_dispatch_nr_slots() returns the number of the
6347-
* remaining slots. scx_bpf_consume() flushes the batch and resets the counter.
6347+
* remaining slots. scx_bpf_dsq_move_to_local() flushes the batch and resets the
6348+
* counter.
63486349
*
63496350
* This function doesn't have any locking restrictions and may be called under
63506351
* BPF locks (in the future when BPF introduces more flexible locking).
@@ -6368,14 +6369,6 @@ __bpf_kfunc void scx_bpf_dsq_insert(struct task_struct *p, u64 dsq_id, u64 slice
63686369
scx_dsq_insert_commit(p, dsq_id, enq_flags);
63696370
}
63706371

6371-
/* for backward compatibility, will be removed in v6.15 */
6372-
__bpf_kfunc void scx_bpf_dispatch(struct task_struct *p, u64 dsq_id, u64 slice,
6373-
u64 enq_flags)
6374-
{
6375-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch() renamed to scx_bpf_dsq_insert()");
6376-
scx_bpf_dsq_insert(p, dsq_id, slice, enq_flags);
6377-
}
6378-
63796372
/**
63806373
* scx_bpf_dsq_insert_vtime - Insert a task into the vtime priority queue of a DSQ
63816374
* @p: task_struct to insert
@@ -6413,21 +6406,11 @@ __bpf_kfunc void scx_bpf_dsq_insert_vtime(struct task_struct *p, u64 dsq_id,
64136406
scx_dsq_insert_commit(p, dsq_id, enq_flags | SCX_ENQ_DSQ_PRIQ);
64146407
}
64156408

6416-
/* for backward compatibility, will be removed in v6.15 */
6417-
__bpf_kfunc void scx_bpf_dispatch_vtime(struct task_struct *p, u64 dsq_id,
6418-
u64 slice, u64 vtime, u64 enq_flags)
6419-
{
6420-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch_vtime() renamed to scx_bpf_dsq_insert_vtime()");
6421-
scx_bpf_dsq_insert_vtime(p, dsq_id, slice, vtime, enq_flags);
6422-
}
6423-
64246409
__bpf_kfunc_end_defs();
64256410

64266411
BTF_KFUNCS_START(scx_kfunc_ids_enqueue_dispatch)
64276412
BTF_ID_FLAGS(func, scx_bpf_dsq_insert, KF_RCU)
64286413
BTF_ID_FLAGS(func, scx_bpf_dsq_insert_vtime, KF_RCU)
6429-
BTF_ID_FLAGS(func, scx_bpf_dispatch, KF_RCU)
6430-
BTF_ID_FLAGS(func, scx_bpf_dispatch_vtime, KF_RCU)
64316414
BTF_KFUNCS_END(scx_kfunc_ids_enqueue_dispatch)
64326415

64336416
static const struct btf_kfunc_id_set scx_kfunc_set_enqueue_dispatch = {
@@ -6600,13 +6583,6 @@ __bpf_kfunc bool scx_bpf_dsq_move_to_local(u64 dsq_id)
66006583
}
66016584
}
66026585

6603-
/* for backward compatibility, will be removed in v6.15 */
6604-
__bpf_kfunc bool scx_bpf_consume(u64 dsq_id)
6605-
{
6606-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_consume() renamed to scx_bpf_dsq_move_to_local()");
6607-
return scx_bpf_dsq_move_to_local(dsq_id);
6608-
}
6609-
66106586
/**
66116587
* scx_bpf_dsq_move_set_slice - Override slice when moving between DSQs
66126588
* @it__iter: DSQ iterator in progress
@@ -6625,14 +6601,6 @@ __bpf_kfunc void scx_bpf_dsq_move_set_slice(struct bpf_iter_scx_dsq *it__iter,
66256601
kit->cursor.flags |= __SCX_DSQ_ITER_HAS_SLICE;
66266602
}
66276603

6628-
/* for backward compatibility, will be removed in v6.15 */
6629-
__bpf_kfunc void scx_bpf_dispatch_from_dsq_set_slice(
6630-
struct bpf_iter_scx_dsq *it__iter, u64 slice)
6631-
{
6632-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch_from_dsq_set_slice() renamed to scx_bpf_dsq_move_set_slice()");
6633-
scx_bpf_dsq_move_set_slice(it__iter, slice);
6634-
}
6635-
66366604
/**
66376605
* scx_bpf_dsq_move_set_vtime - Override vtime when moving between DSQs
66386606
* @it__iter: DSQ iterator in progress
@@ -6652,14 +6620,6 @@ __bpf_kfunc void scx_bpf_dsq_move_set_vtime(struct bpf_iter_scx_dsq *it__iter,
66526620
kit->cursor.flags |= __SCX_DSQ_ITER_HAS_VTIME;
66536621
}
66546622

6655-
/* for backward compatibility, will be removed in v6.15 */
6656-
__bpf_kfunc void scx_bpf_dispatch_from_dsq_set_vtime(
6657-
struct bpf_iter_scx_dsq *it__iter, u64 vtime)
6658-
{
6659-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch_from_dsq_set_vtime() renamed to scx_bpf_dsq_move_set_vtime()");
6660-
scx_bpf_dsq_move_set_vtime(it__iter, vtime);
6661-
}
6662-
66636623
/**
66646624
* scx_bpf_dsq_move - Move a task from DSQ iteration to a DSQ
66656625
* @it__iter: DSQ iterator in progress
@@ -6692,15 +6652,6 @@ __bpf_kfunc bool scx_bpf_dsq_move(struct bpf_iter_scx_dsq *it__iter,
66926652
p, dsq_id, enq_flags);
66936653
}
66946654

6695-
/* for backward compatibility, will be removed in v6.15 */
6696-
__bpf_kfunc bool scx_bpf_dispatch_from_dsq(struct bpf_iter_scx_dsq *it__iter,
6697-
struct task_struct *p, u64 dsq_id,
6698-
u64 enq_flags)
6699-
{
6700-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch_from_dsq() renamed to scx_bpf_dsq_move()");
6701-
return scx_bpf_dsq_move(it__iter, p, dsq_id, enq_flags);
6702-
}
6703-
67046655
/**
67056656
* scx_bpf_dsq_move_vtime - Move a task from DSQ iteration to a PRIQ DSQ
67066657
* @it__iter: DSQ iterator in progress
@@ -6726,30 +6677,16 @@ __bpf_kfunc bool scx_bpf_dsq_move_vtime(struct bpf_iter_scx_dsq *it__iter,
67266677
p, dsq_id, enq_flags | SCX_ENQ_DSQ_PRIQ);
67276678
}
67286679

6729-
/* for backward compatibility, will be removed in v6.15 */
6730-
__bpf_kfunc bool scx_bpf_dispatch_vtime_from_dsq(struct bpf_iter_scx_dsq *it__iter,
6731-
struct task_struct *p, u64 dsq_id,
6732-
u64 enq_flags)
6733-
{
6734-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch_from_dsq_vtime() renamed to scx_bpf_dsq_move_vtime()");
6735-
return scx_bpf_dsq_move_vtime(it__iter, p, dsq_id, enq_flags);
6736-
}
6737-
67386680
__bpf_kfunc_end_defs();
67396681

67406682
BTF_KFUNCS_START(scx_kfunc_ids_dispatch)
67416683
BTF_ID_FLAGS(func, scx_bpf_dispatch_nr_slots)
67426684
BTF_ID_FLAGS(func, scx_bpf_dispatch_cancel)
67436685
BTF_ID_FLAGS(func, scx_bpf_dsq_move_to_local)
6744-
BTF_ID_FLAGS(func, scx_bpf_consume)
67456686
BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_slice)
67466687
BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_vtime)
67476688
BTF_ID_FLAGS(func, scx_bpf_dsq_move, KF_RCU)
67486689
BTF_ID_FLAGS(func, scx_bpf_dsq_move_vtime, KF_RCU)
6749-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq_set_slice)
6750-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq_set_vtime)
6751-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq, KF_RCU)
6752-
BTF_ID_FLAGS(func, scx_bpf_dispatch_vtime_from_dsq, KF_RCU)
67536690
BTF_KFUNCS_END(scx_kfunc_ids_dispatch)
67546691

67556692
static const struct btf_kfunc_id_set scx_kfunc_set_dispatch = {
@@ -6880,10 +6817,6 @@ BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_slice)
68806817
BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_vtime)
68816818
BTF_ID_FLAGS(func, scx_bpf_dsq_move, KF_RCU)
68826819
BTF_ID_FLAGS(func, scx_bpf_dsq_move_vtime, KF_RCU)
6883-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq_set_slice)
6884-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq_set_vtime)
6885-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq, KF_RCU)
6886-
BTF_ID_FLAGS(func, scx_bpf_dispatch_vtime_from_dsq, KF_RCU)
68876820
BTF_KFUNCS_END(scx_kfunc_ids_unlocked)
68886821

68896822
static const struct btf_kfunc_id_set scx_kfunc_set_unlocked = {

0 commit comments

Comments
 (0)