mbox series

[bpf-next,v4,0/4] bpf: RLIMIT_MEMLOCK cleanups

Message ID 20220409125958.92629-1-laoar.shao@gmail.com (mailing list archive)
Headers show
Series bpf: RLIMIT_MEMLOCK cleanups | expand

Message

Yafang Shao April 9, 2022, 12:59 p.m. UTC
We have switched to memcg-based memory accouting and thus the rlimit is
not needed any more. LIBBPF_STRICT_AUTO_RLIMIT_MEMLOCK was introduced in
libbpf for backward compatibility, so we can use it instead now.

This patchset cleanups the usage of RLIMIT_MEMLOCK in tools/bpf/,
tools/testing/selftests/bpf and samples/bpf. The file
tools/testing/selftests/bpf/bpf_rlimit.h is removed. The included header
sys/resource.h is removed from many files as it is useless in these files.

- v4: Squash patches and use customary subject prefixes. (Andrii)
- v3: Get rid of bpf_rlimit.h and fix some typos (Andrii)
- v2: Use libbpf_set_strict_mode instead. (Andrii)
- v1: https://lore.kernel.org/bpf/20220320060815.7716-2-laoar.shao@gmail.com/

Yafang Shao (4):
  samples/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK
  selftests/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK
  bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK
  tools/runqslower: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK

 samples/bpf/cpustat_user.c                    |  1 -
 samples/bpf/hbm.c                             |  5 ++--
 samples/bpf/ibumad_user.c                     |  1 -
 samples/bpf/map_perf_test_user.c              |  1 -
 samples/bpf/offwaketime_user.c                |  1 -
 samples/bpf/sockex2_user.c                    |  1 -
 samples/bpf/sockex3_user.c                    |  1 -
 samples/bpf/spintest_user.c                   |  1 -
 samples/bpf/syscall_tp_user.c                 |  1 -
 samples/bpf/task_fd_query_user.c              |  1 -
 samples/bpf/test_lru_dist.c                   |  1 -
 samples/bpf/test_map_in_map_user.c            |  1 -
 samples/bpf/test_overhead_user.c              |  1 -
 samples/bpf/tracex2_user.c                    |  1 -
 samples/bpf/tracex3_user.c                    |  1 -
 samples/bpf/tracex4_user.c                    |  1 -
 samples/bpf/tracex5_user.c                    |  1 -
 samples/bpf/tracex6_user.c                    |  1 -
 samples/bpf/xdp1_user.c                       |  1 -
 samples/bpf/xdp_adjust_tail_user.c            |  1 -
 samples/bpf/xdp_monitor_user.c                |  1 -
 samples/bpf/xdp_redirect_cpu_user.c           |  1 -
 samples/bpf/xdp_redirect_map_multi_user.c     |  1 -
 samples/bpf/xdp_redirect_user.c               |  1 -
 samples/bpf/xdp_router_ipv4_user.c            |  1 -
 samples/bpf/xdp_rxq_info_user.c               |  1 -
 samples/bpf/xdp_sample_pkts_user.c            |  1 -
 samples/bpf/xdp_sample_user.c                 |  1 -
 samples/bpf/xdp_tx_iptunnel_user.c            |  1 -
 samples/bpf/xdpsock_user.c                    |  9 ++----
 samples/bpf/xsk_fwd.c                         |  7 ++---
 tools/bpf/bpftool/common.c                    |  8 ------
 tools/bpf/bpftool/feature.c                   |  2 --
 tools/bpf/bpftool/main.c                      |  6 ++--
 tools/bpf/bpftool/main.h                      |  2 --
 tools/bpf/bpftool/map.c                       |  2 --
 tools/bpf/bpftool/pids.c                      |  1 -
 tools/bpf/bpftool/prog.c                      |  3 --
 tools/bpf/bpftool/struct_ops.c                |  2 --
 tools/bpf/runqslower/runqslower.c             | 18 ++----------
 tools/testing/selftests/bpf/bench.c           |  1 -
 tools/testing/selftests/bpf/bpf_rlimit.h      | 28 -------------------
 .../selftests/bpf/flow_dissector_load.c       |  6 ++--
 .../selftests/bpf/get_cgroup_id_user.c        |  4 ++-
 tools/testing/selftests/bpf/prog_tests/btf.c  |  1 -
 .../selftests/bpf/test_cgroup_storage.c       |  4 ++-
 tools/testing/selftests/bpf/test_dev_cgroup.c |  4 ++-
 tools/testing/selftests/bpf/test_lpm_map.c    |  4 ++-
 tools/testing/selftests/bpf/test_lru_map.c    |  4 ++-
 .../selftests/bpf/test_skb_cgroup_id_user.c   |  4 ++-
 tools/testing/selftests/bpf/test_sock.c       |  4 ++-
 tools/testing/selftests/bpf/test_sock_addr.c  |  4 ++-
 tools/testing/selftests/bpf/test_sockmap.c    |  5 ++--
 tools/testing/selftests/bpf/test_sysctl.c     |  4 ++-
 tools/testing/selftests/bpf/test_tag.c        |  4 ++-
 .../bpf/test_tcp_check_syncookie_user.c       |  4 ++-
 .../selftests/bpf/test_tcpnotify_user.c       |  1 -
 .../testing/selftests/bpf/test_verifier_log.c |  5 ++--
 .../selftests/bpf/xdp_redirect_multi.c        |  1 -
 tools/testing/selftests/bpf/xdping.c          |  8 ++----
 tools/testing/selftests/bpf/xdpxceiver.c      |  6 ++--
 61 files changed, 57 insertions(+), 142 deletions(-)
 delete mode 100644 tools/testing/selftests/bpf/bpf_rlimit.h

Comments

patchwork-bot+netdevbpf@kernel.org April 11, 2022, 3:30 a.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Sat,  9 Apr 2022 12:59:54 +0000 you wrote:
> We have switched to memcg-based memory accouting and thus the rlimit is
> not needed any more. LIBBPF_STRICT_AUTO_RLIMIT_MEMLOCK was introduced in
> libbpf for backward compatibility, so we can use it instead now.
> 
> This patchset cleanups the usage of RLIMIT_MEMLOCK in tools/bpf/,
> tools/testing/selftests/bpf and samples/bpf. The file
> tools/testing/selftests/bpf/bpf_rlimit.h is removed. The included header
> sys/resource.h is removed from many files as it is useless in these files.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v4,1/4] samples/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK
    https://git.kernel.org/bpf/bpf-next/c/b25acdafd373
  - [bpf-next,v4,2/4] selftests/bpf: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK
    https://git.kernel.org/bpf/bpf-next/c/b858ba8c52b6
  - [bpf-next,v4,3/4] bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK
    https://git.kernel.org/bpf/bpf-next/c/a777e18f1bcd
  - [bpf-next,v4,4/4] tools/runqslower: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK
    https://git.kernel.org/bpf/bpf-next/c/451b5fbc2c56

You are awesome, thank you!