All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH bpf-next v2 0/5] bpf, sched_ext: Make kfunc filters support struct_ops context to reduce runtime overhead
@ 2025-02-14 20:03 Juntong Deng
  2025-02-14 20:09 ` [RFC PATCH bpf-next v2 1/5] bpf: Add struct_ops context information to struct bpf_prog_aux Juntong Deng
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Juntong Deng @ 2025-02-14 20:03 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 to reduce SCX runtime overhead.

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).

This patch series version uses a completely new design in filtering.

Use scx_ops_context_flags to declare context-sensitive SCX kfuncs that
can be used by each SCX operation, no longer need to compare moff
in filters.

Use scx_kfunc_ids_ops_context to implement unified filtering context-
sensitive SCX kfuncs, using different kfunc id sets for grouping
purposes and filtering purposes, no longer need to add multiple filters.

This is still an RFC patch series.

If I got something wrong please let me know.

Signed-off-by: Juntong Deng <juntong.deng@outlook.com>
---
v1 -> v2:
* Use completely new design in filtering

* v1 link: https://lore.kernel.org/bpf/AM6PR03MB5080261D024B49D26F3FFF0099F72@AM6PR03MB5080.eurprd03.prod.outlook.com/T/#t

Juntong Deng (5):
  bpf: Add struct_ops context information to struct bpf_prog_aux
  sched_ext: Declare context-sensitive kfunc groups that can be used by
    different SCX operations
  sched_ext: Add scx_kfunc_ids_ops_context for unified filtering of
    context-sensitive SCX kfuncs
  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                            | 395 ++++++++----------
 .../sched_ext/enq_select_cpu_fails.c          |  35 +-
 5 files changed, 190 insertions(+), 274 deletions(-)

-- 
2.39.5


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

end of thread, other threads:[~2025-02-26 19:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-14 20:03 [RFC PATCH bpf-next v2 0/5] bpf, sched_ext: Make kfunc filters support struct_ops context to reduce runtime overhead Juntong Deng
2025-02-14 20:09 ` [RFC PATCH bpf-next v2 1/5] bpf: Add struct_ops context information to struct bpf_prog_aux Juntong Deng
2025-02-14 20:09 ` [RFC PATCH bpf-next v2 2/5] sched_ext: Declare context-sensitive kfunc groups that can be used by different SCX operations Juntong Deng
2025-02-14 20:09 ` [RFC PATCH bpf-next v2 3/5] sched_ext: Add scx_kfunc_ids_ops_context for unified filtering of context-sensitive SCX kfuncs Juntong Deng
2025-02-26  5:24   ` Alexei Starovoitov
2025-02-26 14:46     ` Andrea Righi
2025-02-26 19:39       ` Juntong Deng
2025-02-14 20:09 ` [RFC PATCH bpf-next v2 4/5] sched_ext: Removed mask-based runtime restrictions on calling kfuncs in different contexts Juntong Deng
2025-02-14 20:09 ` [RFC PATCH bpf-next v2 5/5] 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.