Re: [PATCH bpf-next v2 31/35] bpf: runqslower: don't touch RLIMIT_MEMLOCK
From: Andrii Nakryiko <hidden>
Date: 2020-07-28 06:03:43
Also in:
bpf, lkml
On Mon, Jul 27, 2020 at 12:24 PM Roman Gushchin [off-list ref] wrote:
Since bpf is not using memlock rlimit for memory accounting, there are no more reasons to bump the limit. Signed-off-by: Roman Gushchin <redacted> --- tools/bpf/runqslower/runqslower.c | 16 ---------------- 1 file changed, 16 deletions(-)
This can go, I suppose, we still have a runqslower variant in BCC with this logic, to show an example on what/how to do this for kernels without this patch set applied. Acked-by: Andrii Nakryiko <redacted>
quoted hunk ↗ jump to hunk
diff --git a/tools/bpf/runqslower/runqslower.c b/tools/bpf/runqslower/runqslower.c index d89715844952..a3380b53ce0c 100644 --- a/tools/bpf/runqslower/runqslower.c +++ b/tools/bpf/runqslower/runqslower.c@@ -88,16 +88,6 @@ int libbpf_print_fn(enum libbpf_print_level level, return vfprintf(stderr, format, args); } -static int bump_memlock_rlimit(void) -{ - struct rlimit rlim_new = { - .rlim_cur = RLIM_INFINITY, - .rlim_max = RLIM_INFINITY, - }; - - return setrlimit(RLIMIT_MEMLOCK, &rlim_new); -} - void handle_event(void *ctx, int cpu, void *data, __u32 data_sz) { const struct event *e = data;@@ -134,12 +124,6 @@ int main(int argc, char **argv) libbpf_set_print(libbpf_print_fn); - err = bump_memlock_rlimit(); - if (err) { - fprintf(stderr, "failed to increase rlimit: %d", err); - return 1; - } - obj = runqslower_bpf__open(); if (!obj) { fprintf(stderr, "failed to open and/or load BPF object\n"); --2.26.2