[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID:
<AM6PR03MB5080261D024B49D26F3FFF0099F72@AM6PR03MB5080.eurprd03.prod.outlook.com>
Date: Wed, 5 Feb 2025 19:27:09 +0000
From: Juntong Deng <juntong.deng@...look.com>
To: ast@...nel.org,
daniel@...earbox.net,
john.fastabend@...il.com,
andrii@...nel.org,
martin.lau@...ux.dev,
eddyz87@...il.com,
song@...nel.org,
yonghong.song@...ux.dev,
kpsingh@...nel.org,
sdf@...ichev.me,
haoluo@...gle.com,
jolsa@...nel.org,
memxor@...il.com,
tj@...nel.org,
void@...ifault.com,
arighi@...dia.com,
changwoo@...lia.com
Cc: bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH bpf-next 0/8] bpf, sched_ext: Make kfunc filters support struct_ops context to reduce runtime overhead
This patch series makes kfunc filters support the use of struct_ops
context information and adds corresponding filters for various kfunc
sets in SCX.
After improving kfunc filters, SCX no longer needs the mask-based
runtime kfuncs call restriction, so this patch removes the mask-based
runtime restriction and updates the corresponding test case.
I added *st_ops as part of the context information to avoid kfuncs being
incorrectly blocked when used in non-SCX scenarios where the member
offsets would have a different meaning (not sure if this is necessary).
Note that this is an RFC patch series and I am not sure if I
misunderstood something or broke something.
If I got something wrong please let me know.
Known issues:
scx_bpf_dsq_move appears in both scx_kfunc_ids_dispatch and
scx_kfunc_ids_unlocked.
This results in scx_bpf_dsq_move being incorrectly blocked by
the filter of scx_kfunc_ids_dispatch in the 'init' context.
The scx_qmap sample program fails because of this.
In the filter-based restrictions, each kfunc can only appear in
one kfunc set.
A possible solution is to add a scx_kfunc_set_unlocked_dispatch
kfunc set.
Signed-off-by: Juntong Deng <juntong.deng@...look.com>
Juntong Deng (8):
bpf: Add struct_ops context information to struct bpf_prog_aux
sched_ext: Add filter for scx_kfunc_ids_select_cpu
sched_ext: Add filter for scx_kfunc_ids_enqueue_dispatch
sched_ext: Add filter for scx_kfunc_ids_dispatch
sched_ext: Add filter for scx_kfunc_ids_cpu_release
sched_ext: Add filter for scx_kfunc_ids_unlocked
sched_ext: Removed mask-based runtime restrictions on calling kfuncs
in different contexts
selftests/sched_ext: Update enq_select_cpu_fails to adapt to
struct_ops context filter
include/linux/bpf.h | 2 +
include/linux/sched/ext.h | 24 --
kernel/bpf/verifier.c | 8 +-
kernel/sched/ext.c | 354 +++++++++---------
.../sched_ext/enq_select_cpu_fails.c | 35 +-
5 files changed, 184 insertions(+), 239 deletions(-)
--
2.39.5
Powered by blists - more mailing lists