[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzamC4RQrQuAgH1DK-qcW3cKFuBEbYRhVz-8UMU+mbTcvA@mail.gmail.com>
Date: Mon, 27 Jul 2020 22:59:33 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Roman Gushchin <guro@...com>
Cc: bpf <bpf@...r.kernel.org>, Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Kernel Team <kernel-team@...com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next v2 29/35] bpf: libbpf: cleanup RLIMIT_MEMLOCK usage
On Mon, Jul 27, 2020 at 4:15 PM Roman Gushchin <guro@...com> wrote:
>
> On Mon, Jul 27, 2020 at 03:05:11PM -0700, Andrii Nakryiko wrote:
> > On Mon, Jul 27, 2020 at 12:21 PM Roman Gushchin <guro@...com> wrote:
> > >
> > > As bpf is not using memlock rlimit for memory accounting anymore,
> > > let's remove the related code from libbpf.
> > >
> > > Bpf operations can't fail because of exceeding the limit anymore.
> > >
> >
> > They can't in the newest kernel, but libbpf will keep working and
> > supporting old kernels for a very long time now. So please don't
> > remove any of this.
>
> Yeah, good point, agree.
> So we just can drop this patch from the series, no other changes
> are needed.
>
> >
> > But it would be nice to add a detection of whether kernel needs a
> > RLIMIT_MEMLOCK bump or not. Is there some simple and reliable way to
> > detect this from user-space?
>
> Hm, the best idea I can think of is to wait for -EPERM before bumping.
> We can in theory look for the presence of memory.stat::percpu in cgroupfs,
> but it's way to cryptic.
>
As I just mentioned on another thread, checking fdinfo's "memlock: 0"
should be reliable enough, no?
> Thanks!
Powered by blists - more mailing lists