Skip to contentSkip to conversation

tools/bpf: fix bpf selftest test_cgroup_storage failure

PATCH Applied Yonghong Song 3 participants 3 messages Aug 17, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/bpf: fix bpf selftest test_cgroup_storage failure

The bpf selftest test_cgroup_storage failed in one of our production test servers.

  # sudo ./test_cgroup_storage
  Failed to create map: Operation not permitted

It turns out this is due to insufficient locked memory with system default 16KB.

Similar to other self tests, let us arm the process with unlimited locked memory. With this change, the test passed.

  # sudo ./test_cgroup_storage
  test_cgroup_storage:PASS
Fixes 68cfa3ac6b8d ("selftests/bpf: add a cgroup storage test")
Cc Roman Gushchin <[email protected]>
---
 tools/testing/selftests/bpf/test_cgroup_storage.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/test_cgroup_storage.c +1 -0
index dc83fb2d3f27..4e196e3bfecf 100644
@@ -5,6 +5,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "bpf_rlimit.h"
 #include "cgroup_helpers.h"
 
 char bpf_log_buf[BPF_LOG_BUF_SIZE];
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 36 lines · Yonghong Song

The bpf selftest test_cgroup_storage failed in one of our production test servers.

  # sudo ./test_cgroup_storage
  Failed to create map: Operation not permitted

It turns out this is due to insufficient locked memory with system default 16KB.

Similar to other self tests, let us arm the process with unlimited locked memory. With this change, the test passed.

  # sudo ./test_cgroup_storage
  test_cgroup_storage:PASS
Fixes 68cfa3ac6b8d ("selftests/bpf: add a cgroup storage test")
Cc Roman Gushchin <[email protected]>
---
 tools/testing/selftests/bpf/test_cgroup_storage.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/test_cgroup_storage.c +1 -0
index dc83fb2d3f27..4e196e3bfecf 100644
@@ -5,6 +5,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "bpf_rlimit.h"
 #include "cgroup_helpers.h"
 
 char bpf_log_buf[BPF_LOG_BUF_SIZE];
Signature · 1 line
2.17.1

Thank you, Yonghong!

#2 lore raw
In reply to Yonghong Song
Quoted 11 lines · Yonghong Song

The bpf selftest test_cgroup_storage failed in one of our production test servers.

  # sudo ./test_cgroup_storage
  Failed to create map: Operation not permitted

It turns out this is due to insufficient locked memory with system default 16KB.

Similar to other self tests, let us arm the process with unlimited locked memory. With this change, the test passed.

Quoted 6 lines
  # sudo ./test_cgroup_storage
  test_cgroup_storage:PASS
Fixes 68cfa3ac6b8d ("selftests/bpf: add a cgroup storage test")
Cc Roman Gushchin <[email protected]>

Applied, Thanks