All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH bpf-next 0/8] bpf, sched_ext: Make kfunc filters support struct_ops context to reduce runtime overhead
@ 2025-02-05 19:27 Juntong Deng
  2025-02-05 19:30 ` [RFC PATCH bpf-next 1/8] bpf: Add struct_ops context information to struct bpf_prog_aux Juntong Deng
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Juntong Deng @ 2025-02-05 19:27 UTC (permalink / raw)
  To: ast, daniel, john.fastabend, andrii, martin.lau, eddyz87, song,
	yonghong.song, kpsingh, sdf, haoluo, jolsa, memxor, tj, void,
	arighi, changwoo
  Cc: bpf, linux-kernel

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@outlook.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


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

end of thread, other threads:[~2025-02-14 20:30 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-05 19:27 [RFC PATCH bpf-next 0/8] bpf, sched_ext: Make kfunc filters support struct_ops context to reduce runtime overhead Juntong Deng
2025-02-05 19:30 ` [RFC PATCH bpf-next 1/8] bpf: Add struct_ops context information to struct bpf_prog_aux Juntong Deng
2025-02-05 19:30 ` [RFC PATCH bpf-next 2/8] sched_ext: Add filter for scx_kfunc_ids_select_cpu Juntong Deng
2025-02-06 22:43   ` Andrea Righi
2025-02-06 23:39   ` Andrea Righi
2025-02-07  0:02     ` Juntong Deng
2025-02-05 19:30 ` [RFC PATCH bpf-next 3/8] sched_ext: Add filter for scx_kfunc_ids_enqueue_dispatch Juntong Deng
2025-02-05 19:30 ` [RFC PATCH bpf-next 4/8] sched_ext: Add filter for scx_kfunc_ids_dispatch Juntong Deng
2025-02-05 19:30 ` [RFC PATCH bpf-next 5/8] sched_ext: Add filter for scx_kfunc_ids_cpu_release Juntong Deng
2025-02-05 19:30 ` [RFC PATCH bpf-next 6/8] sched_ext: Add filter for scx_kfunc_ids_unlocked Juntong Deng
2025-02-08  3:37   ` Alexei Starovoitov
2025-02-09 15:22     ` Andrea Righi
2025-02-10 18:05     ` Tejun Heo
2025-02-10 23:40     ` Juntong Deng
2025-02-11  3:48       ` Alexei Starovoitov
2025-02-14 20:30         ` Juntong Deng
2025-02-05 19:30 ` [RFC PATCH bpf-next 7/8] sched_ext: Removed mask-based runtime restrictions on calling kfuncs in different contexts Juntong Deng
2025-02-05 19:30 ` [RFC PATCH bpf-next 8/8] selftests/sched_ext: Update enq_select_cpu_fails to adapt to struct_ops context filter Juntong Deng

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.