Thread (3 messages) flat view 3 messages, 2 authors, 2020-07-28

Re: [PATCH v3 bpf 2/2] selftests/bpf: extend map-in-map selftest to detect memory leaks

From: Song Liu <song@kernel.org>
Date: 2020-07-28 20:54:47
Also in: bpf, stable

On Mon, Jul 27, 2020 at 5:32 PM Andrii Nakryiko [off-list ref] wrote:
Add test validating that all inner maps are released properly after skeleton
is destroyed. To ensure determinism, trigger kernel-side synchronize_rcu()
before checking map existence by their IDs.

Signed-off-by: Andrii Nakryiko <redacted>
Acked-by: Song Liu <redacted>

With one last nitpick...
quoted hunk ↗ jump to hunk
---
 .../selftests/bpf/prog_tests/btf_map_in_map.c | 124 ++++++++++++++++--
 1 file changed, 110 insertions(+), 14 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/btf_map_in_map.c b/tools/testing/selftests/bpf/prog_tests/btf_map_in_map.c
index f7ee8fa377ad..2af1996df6f3 100644
--- a/tools/testing/selftests/bpf/prog_tests/btf_map_in_map.c
+++ b/tools/testing/selftests/bpf/prog_tests/btf_map_in_map.c
@@ -5,10 +5,60 @@

 #include "test_btf_map_in_map.skel.h"

+static int duration;
+
+__u32 bpf_map_id(struct bpf_map *map)
nit: We can make this function static.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help