Re: [PATCH v2] bpf/verifier: optimize ID mapping reset in states_equal

From: Eduard Zingerman

Date: Mon Jan 19 2026 - 14:42:07 EST


On Fri, 2026-01-16 at 17:08 +0800, Qiliang Yuan wrote:

[...]

> Metric | Baseline | Patched | Delta
> ----------------|---------------|---------------|----------
> Iterations | 5710 | 5731 | +0.37%
> Instructions | 1.714 T | 1.555 T | -9.28%
> Inst/Iter | 300.2 M | 271.3 M | -9.63%
> Cycles | 1.436 T | 1.335 T | -7.03%
> Branches | 350.4 B | 311.9 B | -10.99%
> Migrations | 25,977 | 23,524 | -9.44%
>
> Test Command:
> seq 1 2000000 | sudo perf stat -a -- \
> timeout 60s xargs -P $(nproc) -I {} ./veristat access_map_in_map.bpf.o

[...]

As discussed in a separate thread, I don't think that system-wide
profiling is a good fit here. When using perf stat for collecting
pyperf180.bpf.o processing stats I don't see a big difference.
Regardless of specific statistics, I think this change should be landed.

> Suggested-by: Eduard Zingerman <eddyz87@xxxxxxxxx>

Please remove this 'Suggested-by', you found this change yourself,
Andrii suggested improving it further (this usually goes to a changelog).

> Suggested-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
> Signed-off-by: Qiliang Yuan <realwujing@xxxxxxxxx>
> ---

Acked-by: Eduard Zingerman <eddyz87@xxxxxxxxx>

[...]