[PATCH] samples/bpf: set resource limit to infinity.

Subsystems: bpf [general] (safe dynamic programs and tools), the rest

STALE3692d

3 messages, 2 authors, 2016-06-25 · open the first message on its own page

[PATCH] samples/bpf: set resource limit to infinity.

From: William Tu <hidden>
Date: 2016-06-24 22:55:35

Signed-off-by: William Tu <redacted>
---
 samples/bpf/test_maps.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/samples/bpf/test_maps.c b/samples/bpf/test_maps.c
index 47bf085..d2bc96e 100644
--- a/samples/bpf/test_maps.c
+++ b/samples/bpf/test_maps.c
@@ -16,6 +16,7 @@
 #include <assert.h>
 #include <sys/wait.h>
 #include <stdlib.h>
+#include <sys/resource.h>
 #include "libbpf.h"
 
 static int map_flags;
@@ -483,6 +484,9 @@ static void run_all_tests(void)
 
 int main(void)
 {
+	struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY};
+
+	setrlimit(RLIMIT_MEMLOCK, &r);
 	map_flags = 0;
 	run_all_tests();
 	map_flags = BPF_F_NO_PREALLOC;
-- 
2.5.0

Re: [PATCH] samples/bpf: set resource limit to infinity.

From: Alexei Starovoitov <hidden>
Date: 2016-06-25 10:14:33

On Fri, Jun 24, 2016 at 03:55:24PM -0700, William Tu wrote:
Signed-off-by: William Tu <redacted>
Acked-by: Alexei Starovoitov <ast@kernel.org>

please provide a proper patch description next time.
subj line alone is not enough.
Not only explain 'what' the patch does, but 'why' as well.

Re: [PATCH] samples/bpf: set resource limit to infinity.

From: William Tu <hidden>
Date: 2016-06-25 14:10:41

Hi Alexei,

Thanks. I will do it next time.
William

On Sat, Jun 25, 2016 at 3:14 AM, Alexei Starovoitov
[off-list ref] wrote:
On Fri, Jun 24, 2016 at 03:55:24PM -0700, William Tu wrote:
quoted
Signed-off-by: William Tu <redacted>
Acked-by: Alexei Starovoitov <ast@kernel.org>

please provide a proper patch description next time.
subj line alone is not enough.
Not only explain 'what' the patch does, but 'why' as well.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help