Re: [PATCH bpf-next v2 2/2] bpf: Remove unnecessary dup/restore subprog_starts and prog clone

From: Eduard Zingerman

Date: Mon Aug 10 2026 - 17:27:45 EST


On Tue, 2026-07-28 at 20:25 +0000, Xu Kuohai wrote:

...

> diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
> index 505d134cd264..ab5da3ff941a 100644
> --- a/kernel/bpf/core.c
> +++ b/kernel/bpf/core.c
> @@ -1564,27 +1564,34 @@ void bpf_jit_prog_release_other(struct bpf_prog *fp, struct bpf_prog *fp_other)
>   * Now this function is used only to blind the main prog and must be invoked only when
>   * bpf_prog_need_blind() returns true.
>   */
> -struct bpf_prog *bpf_jit_blind_constants(struct bpf_verifier_env *env, struct bpf_prog *prog)
> +int bpf_jit_blind_constants(struct bpf_verifier_env *env, struct bpf_prog **pprog,
> +     bool clone_needed, bool *cloned)

Imo, the code is harder to understand after this change.
Maybe it would be simpler if clone_needed/cloned handling would moved
to the caller. In the current form I'm not convinced the change is warranted.

...