Skip to content

libbpf: auto-bump RLIMIT_MEMLOCK on old kernels

Andrii Nakryiko bpf 4 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 0 repliesApplied 2/2
  2. v32 patches 6 repliesSuperseded
  3. v22 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches2 repliesSuperseded

Changes in v4 from the cover letter

- use detection based on bpf_ktime_get_coarse_ns() helper (Daniel);

Patches in v4 All 2 applied

#Subject and filesSizeRepliesApplied
1/2libbpf: auto-bump RLIMIT_MEMLOCK if kernel needs it for BPFtools/lib/bpf/bpf.c tools/lib/bpf/bpf.h tools/lib/bpf/libbpf.c +3 more+143 -390 repliesApplied
2/2selftests/bpf: remove explicit setrlimit(RLIMIT_MEMLOCK) in main selfteststools/testing/selftests/bpf/bench.c tools/testing/selftests/bpf/prog_tests/btf.c tools/testing/selftests/bpf/prog_tests/select_reuseport.c +5 more+3 -240 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 bpf-next 0/2] libbpf: auto-bump RLIMIT_MEMLOCK on old kernels

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(-)
Signature · 1 line
2.30.2