Re: [PATCH bpf-next v2 31/35] bpf: runqslower: don't touch RLIMIT_MEMLOCK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 27, 2020 at 12:24 PM Roman Gushchin <guro@xxxxxx> 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@xxxxxx>
> ---
>  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 <andriin@xxxxxx>

> 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
>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux