Re: [PATCH bpf-next 2/6] selftests/bpf: add batched, mostly in-kernel BPF triggering benchmarks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 25, 2024 at 10:21 AM Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:
>
> On Thu, Mar 21, 2024 at 5:00 PM Andrii Nakryiko <andrii@xxxxxxxxxx> wrote:
> > +
> > +static error_t parse_arg(int key, char *arg, struct argp_state *state)
> > +{
> > +       long ret;
> > +
> > +       switch (key) {
> > +       case ARG_TRIG_BATCH_ITERS:
> > +               ret = strtol(arg, NULL, 10);
> > +               if (ret < 1 || ret > UINT_MAX) {
> > +                       fprintf(stderr, "invalid --trig-batch-iters value");
> > +                       argp_usage(state);
> > +               }
>
> ...
>
> > +const volatile int batch_iters = 0;
> > +
> > +SEC("raw_tp")
> > +int trigger_count(void *ctx)
> > +{
> > +       int i;
> > +
> > +       for (i = 0; i < batch_iters; i++)
> > +               inc_counter();
>
> so it's passing the verifier due to bounded loop logic, right?

yep

>
> Then let's limit cmd line arg to something small instead of UINT_MAX.
> Otherwise users will be surprised by the errors
> coming from --trig-batch-iters 500k

sure, I don't think it makes any difference much beyond 100-200, I
tried 500 and it made no difference. So I can limit it to 500 or a
1000





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux