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

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

 



On Mon, Jul 27, 2020 at 4:15 PM Andrii Nakryiko <andriin@xxxxxx> 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 <andriin@xxxxxx>

Acked-by: Song Liu <songliubraving@xxxxxx>

With a couple nit below.

> ---
>  .../selftests/bpf/prog_tests/btf_map_in_map.c | 121 ++++++++++++++++--
>  1 file changed, 108 insertions(+), 13 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..c06b61235212 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,59 @@
>
>  #include "test_btf_map_in_map.skel.h"
>
> +static int duration;
> +
> +__u32 bpf_map_id(struct bpf_map *map)

Make the function static?

[...]

> +int kern_sync_rcu() {

static int kern_sync_rcu(void)
{

checkpatch.pl should complain here.

Thanks,
Song

[...]



[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