]> git.hungrycats.org Git - linux/commit
selftsets/bpf: Retry map update on helper_fill_hashmap()
authorGabriele Monaco <gmonaco@redhat.com>
Thu, 11 Jun 2026 15:07:03 +0000 (17:07 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 15 Jun 2026 04:27:28 +0000 (21:27 -0700)
commit1f32c0d619d996b395f36a920f58159949be922a
treee7d326cc96ba45f3e0028209bd8a158bea792079
parent05ae621d4e3c7bfdcc0a4eef1d66eccfc789ee62
selftsets/bpf: Retry map update on helper_fill_hashmap()

helper_fill_hashmap() is used also on parallel and stress map tests.
Those are consistently failing with ENOMEM on kernels built with
PREEMPT_RT if preallocation is disabled. The failure is transient and
only called by the memory cache refill running in a preemptible
irq_work, which can easily stall in case of contention.

Use a retriable update in those cases to handle transient ENOMEM and
make the test more stable also on PREEMPT_RT.
Also fix the sign of the value printed in case of error (strerror()
expects a positive errno while updates return it negative).

Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/r/20260611150704.95133-1-gmonaco@redhat.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/test_maps.c