BPF List
 help / color / mirror / Atom feed
From: Mahe Tardy <mahe.tardy@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	John Fastabend <john.fastabend@gmail.com>,
	Eduard <eddyz87@gmail.com>, Andrii Nakryiko <andrii@kernel.org>,
	Paul Chaignon <paul.chaignon@gmail.com>
Subject: Re: [PATCH bpf-next] verifier: add prune points to live registers print
Date: Tue, 23 Dec 2025 11:12:16 +0100	[thread overview]
Message-ID: <aUprAOkSFgHyUMfB@gmail.com> (raw)
In-Reply-To: <CAADnVQLF+ihK16J3x5pQcJY0t2_gUHiur7ENZNqJdazzr+f8Pg@mail.gmail.com>

On Mon, Dec 22, 2025 at 08:32:57PM -1000, Alexei Starovoitov wrote:
> On Mon, Dec 22, 2025 at 8:58 AM Mahe Tardy <mahe.tardy@gmail.com> wrote:
> > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> > index d6b8a77fbe3b..a82702405c12 100644
> > --- a/kernel/bpf/verifier.c
> > +++ b/kernel/bpf/verifier.c
> > @@ -24892,7 +24892,7 @@ static int compute_live_registers(struct bpf_verifier_env *env)
> >                 insn_aux[i].live_regs_before = state[i].in;
> >
> >         if (env->log.level & BPF_LOG_LEVEL2) {
> > -               verbose(env, "Live regs before insn:\n");
> > +               verbose(env, "Live regs before insn, pruning points (p), and force checkpoints (P):\n");
> >                 for (i = 0; i < insn_cnt; ++i) {
> >                         if (env->insn_aux_data[i].scc)
> >                                 verbose(env, "%3d ", env->insn_aux_data[i].scc);
> > @@ -24904,7 +24904,12 @@ static int compute_live_registers(struct bpf_verifier_env *env)
> >                                         verbose(env, "%d", j);
> >                                 else
> >                                         verbose(env, ".");
> > -                       verbose(env, " ");
> > +                       if (is_force_checkpoint(env, i))
> > +                               verbose(env, " P ");
> > +                       else if (is_prune_point(env, i))
> > +                               verbose(env, " p ");
> > +                       else
> > +                               verbose(env, "   ");
> 
> tbh I don't quite see the value. I never needed to know
> the exact pruning points while working on the verifier.
> It has to work with existing pruning heuristics and with
> BPF_F_TEST_STATE_FREQ. So pruning points shouldn't matter
> to the verifier algorithms. If they are we have a bigger problem
> to solve than show them in the verifier log to users
> who won't be able to make much sense of them.

Yeah I think we would agree with Paul on that. And as you mention, with
the addition of the heuristics on top of prune points, it would maybe be
more useful to know when the verifier actually saves a new state (but
that would increase log verbosity).

> It's my .02. If other folks feel that it's definitely
> useful we can introduce this extra verbosity,
> but all the churn in the selftests is another indication
> of a feature that "nice, but..."

Tbh that's also when I realized that indeed it was "nice, but..." since
because of those changes, all those liveness tests would depend on the
position of prune points. 

At the same time, the new print would allow us to write a series of
tests to check for all the possible cases of prune points as presented
in the talk, not sure it's actually useful as well...


  reply	other threads:[~2025-12-23 10:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-22 18:58 [PATCH bpf-next] verifier: add prune points to live registers print Mahe Tardy
2025-12-22 20:50 ` Yonghong Song
2025-12-23  6:32 ` Alexei Starovoitov
2025-12-23 10:12   ` Mahe Tardy [this message]
2025-12-29 18:48     ` Eduard Zingerman
2025-12-30  0:42       ` Alexei Starovoitov
2025-12-30  1:13         ` Eduard Zingerman
2025-12-30 18:06           ` Alexei Starovoitov
2025-12-30 18:44             ` Eduard Zingerman
2025-12-31  1:11               ` Alexei Starovoitov
2025-12-31  5:47                 ` Eduard Zingerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aUprAOkSFgHyUMfB@gmail.com \
    --to=mahe.tardy@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=paul.chaignon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox