Skip to content

Commit 441c725

Browse files
Hou TaoAlexei Starovoitov
authored andcommitted
selftests/bpf: Close cgrp fd before calling cleanup_cgroup_environment()
There is error log when htab-mem benchmark completes. The error log looks as follows: $ ./bench htab-mem -d1 Setting up benchmark 'htab-mem'... Benchmark 'htab-mem' started. ...... (cgroup_helpers.c:353: errno: Device or resource busy) umount cgroup2 Fix it by closing cgrp fd before invoking cleanup_cgroup_environment(). Signed-off-by: Hou Tao <houtao1@huawei.com> Link: https://lore.kernel.org/r/20231219135727.2661527-1-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 85dd93a commit 441c725

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/testing/selftests/bpf/benchs/bench_htab_mem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ static void htab_mem_report_final(struct bench_res res[], int res_cnt)
335335
" peak memory usage %7.2lfMiB\n",
336336
loop_mean, loop_stddev, mem_mean, mem_stddev, peak_mem / 1048576.0);
337337

338+
close(ctx.fd);
338339
cleanup_cgroup_environment();
339340
}
340341

0 commit comments

Comments
 (0)