Skip to content

Commit 4ecf837

Browse files
JakeHillionhtejun
authored andcommitted
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 <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent cb44400 commit 4ecf837

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
@@ -6391,7 +6391,8 @@ __bpf_kfunc_start_defs();
63916391
* When called from ops.dispatch(), there are no restrictions on @p or @dsq_id
63926392
* and this function can be called upto ops.dispatch_max_batch times to insert
63936393
* multiple tasks. scx_bpf_dispatch_nr_slots() returns the number of the
6394-
* remaining slots. scx_bpf_consume() flushes the batch and resets the counter.
6394+
* remaining slots. scx_bpf_dsq_move_to_local() flushes the batch and resets the
6395+
* counter.
63956396
*
63966397
* This function doesn't have any locking restrictions and may be called under
63976398
* BPF locks (in the future when BPF introduces more flexible locking).
@@ -6415,14 +6416,6 @@ __bpf_kfunc void scx_bpf_dsq_insert(struct task_struct *p, u64 dsq_id, u64 slice
64156416
scx_dsq_insert_commit(p, dsq_id, enq_flags);
64166417
}
64176418

6418-
/* for backward compatibility, will be removed in v6.15 */
6419-
__bpf_kfunc void scx_bpf_dispatch(struct task_struct *p, u64 dsq_id, u64 slice,
6420-
u64 enq_flags)
6421-
{
6422-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch() renamed to scx_bpf_dsq_insert()");
6423-
scx_bpf_dsq_insert(p, dsq_id, slice, enq_flags);
6424-
}
6425-
64266419
/**
64276420
* scx_bpf_dsq_insert_vtime - Insert a task into the vtime priority queue of a DSQ
64286421
* @p: task_struct to insert
@@ -6460,21 +6453,11 @@ __bpf_kfunc void scx_bpf_dsq_insert_vtime(struct task_struct *p, u64 dsq_id,
64606453
scx_dsq_insert_commit(p, dsq_id, enq_flags | SCX_ENQ_DSQ_PRIQ);
64616454
}
64626455

6463-
/* for backward compatibility, will be removed in v6.15 */
6464-
__bpf_kfunc void scx_bpf_dispatch_vtime(struct task_struct *p, u64 dsq_id,
6465-
u64 slice, u64 vtime, u64 enq_flags)
6466-
{
6467-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch_vtime() renamed to scx_bpf_dsq_insert_vtime()");
6468-
scx_bpf_dsq_insert_vtime(p, dsq_id, slice, vtime, enq_flags);
6469-
}
6470-
64716456
__bpf_kfunc_end_defs();
64726457

64736458
BTF_KFUNCS_START(scx_kfunc_ids_enqueue_dispatch)
64746459
BTF_ID_FLAGS(func, scx_bpf_dsq_insert, KF_RCU)
64756460
BTF_ID_FLAGS(func, scx_bpf_dsq_insert_vtime, KF_RCU)
6476-
BTF_ID_FLAGS(func, scx_bpf_dispatch, KF_RCU)
6477-
BTF_ID_FLAGS(func, scx_bpf_dispatch_vtime, KF_RCU)
64786461
BTF_KFUNCS_END(scx_kfunc_ids_enqueue_dispatch)
64796462

64806463
static const struct btf_kfunc_id_set scx_kfunc_set_enqueue_dispatch = {
@@ -6647,13 +6630,6 @@ __bpf_kfunc bool scx_bpf_dsq_move_to_local(u64 dsq_id)
66476630
}
66486631
}
66496632

6650-
/* for backward compatibility, will be removed in v6.15 */
6651-
__bpf_kfunc bool scx_bpf_consume(u64 dsq_id)
6652-
{
6653-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_consume() renamed to scx_bpf_dsq_move_to_local()");
6654-
return scx_bpf_dsq_move_to_local(dsq_id);
6655-
}
6656-
66576633
/**
66586634
* scx_bpf_dsq_move_set_slice - Override slice when moving between DSQs
66596635
* @it__iter: DSQ iterator in progress
@@ -6672,14 +6648,6 @@ __bpf_kfunc void scx_bpf_dsq_move_set_slice(struct bpf_iter_scx_dsq *it__iter,
66726648
kit->cursor.flags |= __SCX_DSQ_ITER_HAS_SLICE;
66736649
}
66746650

6675-
/* for backward compatibility, will be removed in v6.15 */
6676-
__bpf_kfunc void scx_bpf_dispatch_from_dsq_set_slice(
6677-
struct bpf_iter_scx_dsq *it__iter, u64 slice)
6678-
{
6679-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch_from_dsq_set_slice() renamed to scx_bpf_dsq_move_set_slice()");
6680-
scx_bpf_dsq_move_set_slice(it__iter, slice);
6681-
}
6682-
66836651
/**
66846652
* scx_bpf_dsq_move_set_vtime - Override vtime when moving between DSQs
66856653
* @it__iter: DSQ iterator in progress
@@ -6699,14 +6667,6 @@ __bpf_kfunc void scx_bpf_dsq_move_set_vtime(struct bpf_iter_scx_dsq *it__iter,
66996667
kit->cursor.flags |= __SCX_DSQ_ITER_HAS_VTIME;
67006668
}
67016669

6702-
/* for backward compatibility, will be removed in v6.15 */
6703-
__bpf_kfunc void scx_bpf_dispatch_from_dsq_set_vtime(
6704-
struct bpf_iter_scx_dsq *it__iter, u64 vtime)
6705-
{
6706-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch_from_dsq_set_vtime() renamed to scx_bpf_dsq_move_set_vtime()");
6707-
scx_bpf_dsq_move_set_vtime(it__iter, vtime);
6708-
}
6709-
67106670
/**
67116671
* scx_bpf_dsq_move - Move a task from DSQ iteration to a DSQ
67126672
* @it__iter: DSQ iterator in progress
@@ -6739,15 +6699,6 @@ __bpf_kfunc bool scx_bpf_dsq_move(struct bpf_iter_scx_dsq *it__iter,
67396699
p, dsq_id, enq_flags);
67406700
}
67416701

6742-
/* for backward compatibility, will be removed in v6.15 */
6743-
__bpf_kfunc bool scx_bpf_dispatch_from_dsq(struct bpf_iter_scx_dsq *it__iter,
6744-
struct task_struct *p, u64 dsq_id,
6745-
u64 enq_flags)
6746-
{
6747-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch_from_dsq() renamed to scx_bpf_dsq_move()");
6748-
return scx_bpf_dsq_move(it__iter, p, dsq_id, enq_flags);
6749-
}
6750-
67516702
/**
67526703
* scx_bpf_dsq_move_vtime - Move a task from DSQ iteration to a PRIQ DSQ
67536704
* @it__iter: DSQ iterator in progress
@@ -6773,30 +6724,16 @@ __bpf_kfunc bool scx_bpf_dsq_move_vtime(struct bpf_iter_scx_dsq *it__iter,
67736724
p, dsq_id, enq_flags | SCX_ENQ_DSQ_PRIQ);
67746725
}
67756726

6776-
/* for backward compatibility, will be removed in v6.15 */
6777-
__bpf_kfunc bool scx_bpf_dispatch_vtime_from_dsq(struct bpf_iter_scx_dsq *it__iter,
6778-
struct task_struct *p, u64 dsq_id,
6779-
u64 enq_flags)
6780-
{
6781-
printk_deferred_once(KERN_WARNING "sched_ext: scx_bpf_dispatch_from_dsq_vtime() renamed to scx_bpf_dsq_move_vtime()");
6782-
return scx_bpf_dsq_move_vtime(it__iter, p, dsq_id, enq_flags);
6783-
}
6784-
67856727
__bpf_kfunc_end_defs();
67866728

67876729
BTF_KFUNCS_START(scx_kfunc_ids_dispatch)
67886730
BTF_ID_FLAGS(func, scx_bpf_dispatch_nr_slots)
67896731
BTF_ID_FLAGS(func, scx_bpf_dispatch_cancel)
67906732
BTF_ID_FLAGS(func, scx_bpf_dsq_move_to_local)
6791-
BTF_ID_FLAGS(func, scx_bpf_consume)
67926733
BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_slice)
67936734
BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_vtime)
67946735
BTF_ID_FLAGS(func, scx_bpf_dsq_move, KF_RCU)
67956736
BTF_ID_FLAGS(func, scx_bpf_dsq_move_vtime, KF_RCU)
6796-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq_set_slice)
6797-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq_set_vtime)
6798-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq, KF_RCU)
6799-
BTF_ID_FLAGS(func, scx_bpf_dispatch_vtime_from_dsq, KF_RCU)
68006737
BTF_KFUNCS_END(scx_kfunc_ids_dispatch)
68016738

68026739
static const struct btf_kfunc_id_set scx_kfunc_set_dispatch = {
@@ -6927,10 +6864,6 @@ BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_slice)
69276864
BTF_ID_FLAGS(func, scx_bpf_dsq_move_set_vtime)
69286865
BTF_ID_FLAGS(func, scx_bpf_dsq_move, KF_RCU)
69296866
BTF_ID_FLAGS(func, scx_bpf_dsq_move_vtime, KF_RCU)
6930-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq_set_slice)
6931-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq_set_vtime)
6932-
BTF_ID_FLAGS(func, scx_bpf_dispatch_from_dsq, KF_RCU)
6933-
BTF_ID_FLAGS(func, scx_bpf_dispatch_vtime_from_dsq, KF_RCU)
69346867
BTF_KFUNCS_END(scx_kfunc_ids_unlocked)
69356868

69366869
static const struct btf_kfunc_id_set scx_kfunc_set_unlocked = {

0 commit comments

Comments
 (0)