All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: support 32-bit linear scalar evolution
@ 2026-10-20 11:06 Eduard Zingerman
  2026-10-20 11:06 ` [PATCH bpf-next 1/2] " Eduard Zingerman
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Eduard Zingerman @ 2026-10-20 11:06 UTC (permalink / raw)
  To: bpf, ast; +Cc: andrii, daniel, kernel-team, yonghong.song, Eduard Zingerman

Support scalar evolution widening for loops like:

     w0 = 0;
  l: w0 += 1;
     if w0 != 3 goto l;
     exit;

Implementation details are covered in the first patch.
Veristat results follow. Program sets: cilium, meta, scx, selftests.
Tables: success in both runs; baseline Insns >= 5,000.
Ranked by percentage change, then instruction-count change, file,
program. Meta names are anonymized.
Top 50 wins are shown, there are no loses.

Histogram
---------

Total progs: 7994
Old success: 5665
New success: 5665
-100 .. -95  %: 21
 -95 .. -85  %: 1
 -85 .. -75  %: 4
 -75 .. -70  %: 17
 -70 .. -65  %: 10
 -65 .. -55  %: 3
 -50 .. -40  %: 2
 -40 .. -30  %: 2
 -25 .. -15  %: 2
 -15 .. -10  %: 7
 -10 .. -5   %: 32
  -5 .. 0    %: 6
   0 .. 5    %: 7887

Top wins (50)
-------------

File                           Program                            Insns (A)  Insns (B)       Insns (DIFF)
-----------------------------  ---------------------------------  ---------  ---------  -----------------
timer_start_delete_race.bpf.o  start_timer                            40007         28   -39979 (-99.93%)
timer_start_delete_race.bpf.o  delete_elem                            14003         11   -13992 (-99.92%)
verifier_bounds.bpf.o          crossing_32_bit_signed_boundary_2      12330         20   -12310 (-99.84%)
access_map_in_map.bpf.o        access_map_in_array                    18457         35   -18422 (-99.81%)
access_map_in_map.bpf.o        access_map_in_htab                     18457         35   -18422 (-99.81%)
access_map_in_map.bpf.o        sleepable_access_map_in_array          18457         35   -18422 (-99.81%)
access_map_in_map.bpf.o        sleepable_access_map_in_htab           18457         35   -18422 (-99.81%)
firewall-09.bpf.o              twfw_connect6                         153638        320  -153318 (-99.79%)
firewall-09.bpf.o              twfw_sendmsg6                         153638        320  -153318 (-99.79%)
firewall-10.bpf.o              twfw_connect4                         102193        241  -101952 (-99.76%)
firewall-10.bpf.o              twfw_sendmsg4                         102193        241  -101952 (-99.76%)
firewall-10.bpf.o              twfw_connect6                         166183        397  -165786 (-99.76%)
firewall-10.bpf.o              twfw_sendmsg6                         166183        397  -165786 (-99.76%)
firewall-09.bpf.o              twfw_connect4                          76030        197   -75833 (-99.74%)
firewall-09.bpf.o              twfw_sendmsg4                          76030        197   -75833 (-99.74%)
linked_list.bpf.o              clear_global_array_list                13071         57   -13014 (-99.56%)
rhash.bpf.o                    test_rhash_update_elements              7584         91    -7493 (-98.80%)
profiler-06.bpf.o              on_perf_event                         425953      94751  -331202 (-77.76%)
profiler-26.bpf.o              handle_cu_mem_address_reserve          45724      12702   -33022 (-72.22%)
profiler-26.bpf.o              handle_cu_mem_create                   45724      12702   -33022 (-72.22%)
profiler-26.bpf.o              handle_malloc                          45724      12702   -33022 (-72.22%)
profiler-19.bpf.o              sched_switch_offcpu                    78210      21906   -56304 (-71.99%)
profiler-26.bpf.o              handle_cu_mem_map                      45922      12900   -33022 (-71.91%)
profiler-09.bpf.o              on_custom_event_start                  45973      12951   -33022 (-71.83%)
profiler-09.bpf.o              trace_func_entry                       45973      12951   -33022 (-71.83%)
profiler-19.bpf.o              sched_waking                           23153       6642   -16511 (-71.31%)
profiler-27.bpf.o              handle_cuda_launch_exc                 23176       6665   -16511 (-71.24%)
profiler-27.bpf.o              handle_cuda_launch                     23189       6678   -16511 (-71.20%)
profiler-12.bpf.o              on_custom_event_begin                  23396       6885   -16511 (-70.57%)
profiler-12.bpf.o              on_custom_event_end                    23400       6889   -16511 (-70.56%)
profiler-26.bpf.o              handle_mtia_cached_alloc               46892      13870   -33022 (-70.42%)
profiler-26.bpf.o              handle_mtia_allocate_enter             46953      13931   -33022 (-70.33%)
profiler-12.bpf.o              sched_switch                           40257      12105   -28152 (-69.93%)
profiler-26.bpf.o              handle_pytorch_malloc                  47245      14223   -33022 (-69.90%)
profiler-19.bpf.o              oncpu                                  23689       7178   -16511 (-69.70%)
profiler-12.bpf.o              on_task_enqueued                       23734       7223   -16511 (-69.57%)
profiler-12.bpf.o              sched_waking                           23769       7258   -16511 (-69.46%)
profiler-12.bpf.o              on_task_dequeued                       23909       7398   -16511 (-69.06%)
profiler-12.bpf.o              on_request_context_event               24000       7489   -16511 (-68.80%)
profiler-12.bpf.o              on_pytorch_event                       24001       7490   -16511 (-68.79%)
profiler-12.bpf.o              on_task_stats                          24083       7572   -16511 (-68.56%)
profiler-12.bpf.o              oncpu                                  24187       7676   -16511 (-68.26%)
scx_rusty.bpf.o                rusty_init                              8784       3171    -5613 (-63.90%)
profiler-12.bpf.o              get_crochet_walltime_stacks            50215      22063   -28152 (-56.06%)
security-sandbox-13.bpf.o      kvm_die                                 5807       2967    -2840 (-48.91%)
profiler-24.bpf.o              get_task_stacks                       103742      64928   -38814 (-37.41%)
scheduler-01.bpf.o             arena_alloc_mask                       29208      25497    -3711 (-12.71%)
scheduler-03.bpf.o             arena_alloc_mask                       29208      25497    -3711 (-12.71%)
file-system-monitor-01.bpf.o   file_lineage_lsm_file_free             20986      18354    -2632 (-12.54%)
file-system-monitor-01.bpf.o   file_lineage_security_file_free        20986      18354    -2632 (-12.54%)

---
Eduard Zingerman (2):
      bpf: support 32-bit linear scalar evolution
      selftests/bpf: tests for 32-bit scalar evolution bounds computation

 include/linux/bpf_verifier.h                       |   2 +-
 kernel/bpf/scev.c                                  | 364 +++++++++++++++------
 kernel/bpf/verifier.c                              |   6 +-
 tools/testing/selftests/bpf/progs/verifier_scev.c  | 273 +++++++++++++++-
 .../selftests/bpf/progs/verifier_stack_ptr.c       |   2 +-
 5 files changed, 536 insertions(+), 111 deletions(-)
---
base-commit: 25bb03f0a47b622b9025a1558bf2095ec1f55d26
change-id: 20261020-scev-32bit-0bcdd0fd6c34

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

end of thread, other threads:[~2026-10-20 21:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20 11:06 [PATCH bpf-next 0/2] bpf: support 32-bit linear scalar evolution Eduard Zingerman
2026-10-20 11:06 ` [PATCH bpf-next 1/2] " Eduard Zingerman
2026-10-20 11:35   ` bot+bpf-ci
2026-10-20 21:00     ` Alexei Starovoitov
2026-10-20 21:06       ` Eduard Zingerman
2026-10-20 11:38   ` sashiko-bot
2026-10-20 11:06 ` [PATCH bpf-next 2/2] selftests/bpf: tests for 32-bit scalar evolution bounds computation Eduard Zingerman
2026-10-20 11:35   ` bot+bpf-ci
2026-10-20 21:00 ` [PATCH bpf-next 0/2] bpf: support 32-bit linear scalar evolution patchwork-bot+netdevbpf

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.