@@ -5802,35 +5802,6 @@ void __init init_sched_ext_class(void)
5802
5802
5803
5803
__bpf_kfunc_start_defs ();
5804
5804
5805
- /**
5806
- * scx_bpf_create_dsq - Create a custom DSQ
5807
- * @dsq_id: DSQ to create
5808
- * @node: NUMA node to allocate from
5809
- *
5810
- * Create a custom DSQ identified by @dsq_id. Can be called from any sleepable
5811
- * scx callback, and any BPF_PROG_TYPE_SYSCALL prog.
5812
- */
5813
- __bpf_kfunc s32 scx_bpf_create_dsq (u64 dsq_id , s32 node )
5814
- {
5815
- if (unlikely (node >= (int )nr_node_ids ||
5816
- (node < 0 && node != NUMA_NO_NODE )))
5817
- return - EINVAL ;
5818
- return PTR_ERR_OR_ZERO (create_dsq (dsq_id , node ));
5819
- }
5820
-
5821
- __bpf_kfunc_end_defs ();
5822
-
5823
- BTF_KFUNCS_START (scx_kfunc_ids_sleepable )
5824
- BTF_ID_FLAGS (func , scx_bpf_create_dsq , KF_SLEEPABLE )
5825
- BTF_KFUNCS_END (scx_kfunc_ids_sleepable )
5826
-
5827
- static const struct btf_kfunc_id_set scx_kfunc_set_sleepable = {
5828
- .owner = THIS_MODULE ,
5829
- .set = & scx_kfunc_ids_sleepable ,
5830
- };
5831
-
5832
- __bpf_kfunc_start_defs ();
5833
-
5834
5805
/**
5835
5806
* scx_bpf_select_cpu_dfl - The default implementation of ops.select_cpu()
5836
5807
* @p: task_struct to select a CPU for
@@ -6173,6 +6144,35 @@ static const struct btf_kfunc_id_set scx_kfunc_set_cpu_release = {
6173
6144
6174
6145
__bpf_kfunc_start_defs ();
6175
6146
6147
+ /**
6148
+ * scx_bpf_create_dsq - Create a custom DSQ
6149
+ * @dsq_id: DSQ to create
6150
+ * @node: NUMA node to allocate from
6151
+ *
6152
+ * Create a custom DSQ identified by @dsq_id. Can be called from any sleepable
6153
+ * scx callback, and any BPF_PROG_TYPE_SYSCALL prog.
6154
+ */
6155
+ __bpf_kfunc s32 scx_bpf_create_dsq (u64 dsq_id , s32 node )
6156
+ {
6157
+ if (unlikely (node >= (int )nr_node_ids ||
6158
+ (node < 0 && node != NUMA_NO_NODE )))
6159
+ return - EINVAL ;
6160
+ return PTR_ERR_OR_ZERO (create_dsq (dsq_id , node ));
6161
+ }
6162
+
6163
+ __bpf_kfunc_end_defs ();
6164
+
6165
+ BTF_KFUNCS_START (scx_kfunc_ids_unlocked )
6166
+ BTF_ID_FLAGS (func , scx_bpf_create_dsq , KF_SLEEPABLE )
6167
+ BTF_KFUNCS_END (scx_kfunc_ids_unlocked )
6168
+
6169
+ static const struct btf_kfunc_id_set scx_kfunc_set_unlocked = {
6170
+ .owner = THIS_MODULE ,
6171
+ .set = & scx_kfunc_ids_unlocked ,
6172
+ };
6173
+
6174
+ __bpf_kfunc_start_defs ();
6175
+
6176
6176
/**
6177
6177
* scx_bpf_kick_cpu - Trigger reschedule on a CPU
6178
6178
* @cpu: cpu to kick
@@ -6907,17 +6907,17 @@ static int __init scx_init(void)
6907
6907
* check using scx_kf_allowed().
6908
6908
*/
6909
6909
if ((ret = register_btf_kfunc_id_set (BPF_PROG_TYPE_STRUCT_OPS ,
6910
- & scx_kfunc_set_sleepable )) ||
6911
- (ret = register_btf_kfunc_id_set (BPF_PROG_TYPE_SYSCALL ,
6912
- & scx_kfunc_set_sleepable )) ||
6913
- (ret = register_btf_kfunc_id_set (BPF_PROG_TYPE_STRUCT_OPS ,
6914
6910
& scx_kfunc_set_select_cpu )) ||
6915
6911
(ret = register_btf_kfunc_id_set (BPF_PROG_TYPE_STRUCT_OPS ,
6916
6912
& scx_kfunc_set_enqueue_dispatch )) ||
6917
6913
(ret = register_btf_kfunc_id_set (BPF_PROG_TYPE_STRUCT_OPS ,
6918
6914
& scx_kfunc_set_dispatch )) ||
6919
6915
(ret = register_btf_kfunc_id_set (BPF_PROG_TYPE_STRUCT_OPS ,
6920
6916
& scx_kfunc_set_cpu_release )) ||
6917
+ (ret = register_btf_kfunc_id_set (BPF_PROG_TYPE_STRUCT_OPS ,
6918
+ & scx_kfunc_set_unlocked )) ||
6919
+ (ret = register_btf_kfunc_id_set (BPF_PROG_TYPE_SYSCALL ,
6920
+ & scx_kfunc_set_unlocked )) ||
6921
6921
(ret = register_btf_kfunc_id_set (BPF_PROG_TYPE_STRUCT_OPS ,
6922
6922
& scx_kfunc_set_any )) ||
6923
6923
(ret = register_btf_kfunc_id_set (BPF_PROG_TYPE_TRACING ,
0 commit comments