[PATCH v3 sched_ext 2/2] sched_ext: Remove bpf_scx_get_func_proto

Feng Yang posted 2 patches 7 months, 2 weeks ago
[PATCH v3 sched_ext 2/2] sched_ext: Remove bpf_scx_get_func_proto
Posted by Feng Yang 7 months, 2 weeks ago
From: Feng Yang <yangfeng@kylinos.cn>

task_storage_{get,delete} has been moved to bpf_base_func_proto.

Suggested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Signed-off-by: Feng Yang <yangfeng@kylinos.cn>
---
 kernel/sched/ext.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index fdbf249d1c68..cc628b009e11 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -5586,21 +5586,8 @@ static int bpf_scx_btf_struct_access(struct bpf_verifier_log *log,
 	return -EACCES;
 }
 
-static const struct bpf_func_proto *
-bpf_scx_get_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
-{
-	switch (func_id) {
-	case BPF_FUNC_task_storage_get:
-		return &bpf_task_storage_get_proto;
-	case BPF_FUNC_task_storage_delete:
-		return &bpf_task_storage_delete_proto;
-	default:
-		return bpf_base_func_proto(func_id, prog);
-	}
-}
-
 static const struct bpf_verifier_ops bpf_scx_verifier_ops = {
-	.get_func_proto = bpf_scx_get_func_proto,
+	.get_func_proto = bpf_base_func_proto,
 	.is_valid_access = bpf_scx_is_valid_access,
 	.btf_struct_access = bpf_scx_btf_struct_access,
 };
-- 
2.43.0
Re: [PATCH v3 sched_ext 2/2] sched_ext: Remove bpf_scx_get_func_proto
Posted by Andrii Nakryiko 7 months, 2 weeks ago
On Mon, May 5, 2025 at 11:15 PM Feng Yang <yangfeng59949@163.com> wrote:
>
> From: Feng Yang <yangfeng@kylinos.cn>
>
> task_storage_{get,delete} has been moved to bpf_base_func_proto.
>
> Suggested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
> Signed-off-by: Feng Yang <yangfeng@kylinos.cn>
> ---
>  kernel/sched/ext.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
>

Given this has dependency on patch #1, we should either route this
patch through bpf-next, or we'll have to delay and resend it after
merge window.

Tejun, any preferences?

> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index fdbf249d1c68..cc628b009e11 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -5586,21 +5586,8 @@ static int bpf_scx_btf_struct_access(struct bpf_verifier_log *log,
>         return -EACCES;
>  }
>
> -static const struct bpf_func_proto *
> -bpf_scx_get_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
> -{
> -       switch (func_id) {
> -       case BPF_FUNC_task_storage_get:
> -               return &bpf_task_storage_get_proto;
> -       case BPF_FUNC_task_storage_delete:
> -               return &bpf_task_storage_delete_proto;
> -       default:
> -               return bpf_base_func_proto(func_id, prog);
> -       }
> -}
> -
>  static const struct bpf_verifier_ops bpf_scx_verifier_ops = {
> -       .get_func_proto = bpf_scx_get_func_proto,
> +       .get_func_proto = bpf_base_func_proto,
>         .is_valid_access = bpf_scx_is_valid_access,
>         .btf_struct_access = bpf_scx_btf_struct_access,
>  };
> --
> 2.43.0
>
Re: [PATCH v3 sched_ext 2/2] sched_ext: Remove bpf_scx_get_func_proto
Posted by Tejun Heo 7 months, 1 week ago
On Tue, May 06, 2025 at 03:30:39PM -0700, Andrii Nakryiko wrote:
> On Mon, May 5, 2025 at 11:15 PM Feng Yang <yangfeng59949@163.com> wrote:
> >
> > From: Feng Yang <yangfeng@kylinos.cn>
> >
> > task_storage_{get,delete} has been moved to bpf_base_func_proto.
> >
> > Suggested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
> > Signed-off-by: Feng Yang <yangfeng@kylinos.cn>
> > ---
> >  kernel/sched/ext.c | 15 +--------------
> >  1 file changed, 1 insertion(+), 14 deletions(-)
> >
> 
> Given this has dependency on patch #1, we should either route this
> patch through bpf-next, or we'll have to delay and resend it after
> merge window.
> 
> Tejun, any preferences?

Yeah, bpf-next sounds good to me and please feel free to add:

 Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun