lkml.org 
[lkml]   [2020]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH bpf-next v2 33/35] bpf: selftests: don't touch RLIMIT_MEMLOCK
On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin <guro@fb.com> 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 <guro@fb.com>
> ---

Similarly for bench, it's a tool that's not coupled with the latest
kernel version, it will be a big step down if the tool doesn't bump
rlimit on its own on slightly older kernels. Let's just keep it for
now.

> tools/testing/selftests/bpf/bench.c | 16 ---------------
> .../selftests/bpf/progs/bpf_iter_bpf_map.c | 5 ++---
> tools/testing/selftests/bpf/xdping.c | 6 ------
> tools/testing/selftests/net/reuseport_bpf.c | 20 -------------------
> 4 files changed, 2 insertions(+), 45 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/bench.c b/tools/testing/selftests/bpf/bench.c
> index 944ad4721c83..f66610541c8a 100644
> --- a/tools/testing/selftests/bpf/bench.c
> +++ b/tools/testing/selftests/bpf/bench.c
> @@ -29,25 +29,9 @@ static 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 setup_libbpf()
> {
> - int err;
> -
> libbpf_set_print(libbpf_print_fn);
> -
> - err = bump_memlock_rlimit();
> - if (err)
> - fprintf(stderr, "failed to increase RLIMIT_MEMLOCK: %d", err);
> }
>

[...]

\
 
 \ /
  Last update: 2020-07-28 08:09    [W:0.367 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site