From: Andrii Nakryiko <andrii@kernel.org>
To: <bpf@vger.kernel.org>, <ast@kernel.org>, <daniel@iogearbox.net>
Cc: <andrii@kernel.org>, <kernel-team@fb.com>
Subject: [PATCH v4 bpf-next 0/2] libbpf: auto-bump RLIMIT_MEMLOCK on old kernels
Date: Tue, 14 Dec 2021 11:59:02 -0800 [thread overview]
Message-ID: <20211214195904.1785155-1-andrii@kernel.org> (raw)
Make libbpf bump RLIMIT_MEMLOCK, similarly to BCC, if kernel is old enough to
use memcg-based memory accounting for BPF. Patch #2 drops explicit
setrlimi(RLIMIT_MEMLOCK) calls in test_progs, test_maps, and test_verifier.
v3->v4:
- use detection based on bpf_ktime_get_coarse_ns() helper (Daniel);
v2->v3:
- use difference in fdinfo's memlock reporting to detect memcg;
v1->v2:
- fix up out-of-sync comments (Toke).
Andrii Nakryiko (2):
libbpf: auto-bump RLIMIT_MEMLOCK if kernel needs it for BPF
selftests/bpf: remove explicit setrlimit(RLIMIT_MEMLOCK) in main
selftests
tools/lib/bpf/bpf.c | 81 +++++++++++++++++++
tools/lib/bpf/bpf.h | 2 +
tools/lib/bpf/libbpf.c | 47 +++--------
tools/lib/bpf/libbpf.map | 1 +
tools/lib/bpf/libbpf_internal.h | 39 +++++++++
tools/lib/bpf/libbpf_legacy.h | 12 ++-
tools/testing/selftests/bpf/bench.c | 16 ----
tools/testing/selftests/bpf/prog_tests/btf.c | 1 -
.../bpf/prog_tests/select_reuseport.c | 1 -
.../selftests/bpf/prog_tests/sk_lookup.c | 1 -
.../selftests/bpf/prog_tests/sock_fields.c | 1 -
tools/testing/selftests/bpf/test_maps.c | 1 -
tools/testing/selftests/bpf/test_progs.c | 2 -
tools/testing/selftests/bpf/test_verifier.c | 4 +-
14 files changed, 146 insertions(+), 63 deletions(-)
--
2.30.2
next reply other threads:[~2021-12-14 19:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-14 19:59 Andrii Nakryiko [this message]
2021-12-14 19:59 ` [PATCH v4 bpf-next 1/2] libbpf: auto-bump RLIMIT_MEMLOCK if kernel needs it for BPF Andrii Nakryiko
2021-12-14 19:59 ` [PATCH v4 bpf-next 2/2] selftests/bpf: remove explicit setrlimit(RLIMIT_MEMLOCK) in main selftests Andrii Nakryiko
2021-12-14 21:20 ` [PATCH v4 bpf-next 0/2] libbpf: auto-bump RLIMIT_MEMLOCK on old kernels patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211214195904.1785155-1-andrii@kernel.org \
--to=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox