Skip to content

chore(driver/modern_bpf): limit bpf_loop helper to 16 iterations. #2397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented May 9, 2025

What type of PR is this?

/kind cleanup

Any specific area of the project related to this PR?

/area driver-modern-bpf

Does this PR require a change in the driver versions?

What this PR does / why we need it:

We noticed that on some kernels, it seems like bpf_loop sendmmsg/recvmmsg programs are slowing down the machine (possibly some kernel bugs?), leading to issues with multiple programs.
Limit bpf_loop iterations to 16 instead of 1024 to mitigate the issue (that will need proper investigation).

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
@FedeDP
Copy link
Contributor Author

FedeDP commented May 9, 2025

/milestone 9.0.0+driver

@poiana poiana added this to the 9.0.0+driver milestone May 9, 2025
@poiana poiana added the size/XS label May 9, 2025
@poiana
Copy link
Contributor

poiana commented May 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana requested review from hbrueckner and leogr May 9, 2025 07:01
@poiana poiana added the approved label May 9, 2025
@FedeDP
Copy link
Contributor Author

FedeDP commented May 9, 2025

/cc @Molter73

@poiana poiana requested a review from Molter73 May 9, 2025 07:01
Copy link

github-actions bot commented May 9, 2025

Perf diff from master - unit tests

     6.88%     -0.85%  [.] sinsp::next
     5.15%     +0.31%  [.] sinsp_evt::get_type
     0.96%     -0.28%  [.] sinsp_parser::event_cleanup
     3.62%     +0.27%  [.] next_event_from_file
     1.41%     +0.22%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_threadinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_threadinfo> > >, std::__detail::_Select1st, std::equal_to<long>, std::hash<long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_before_node
     0.50%     -0.19%  [.] scap_next
     1.60%     +0.16%  [.] sinsp_parser::process_event
     0.50%     -0.16%  [.] convert_event
     1.44%     -0.15%  [.] user_group_updater::~user_group_updater
     4.85%     -0.14%  [.] sinsp_parser::reset

Heap diff from master - unit tests

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Benchmarks diff from master

Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark                                                         Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean                                            +0.0184         +0.0186           148           150           148           150
BM_sinsp_split_median                                          +0.0177         +0.0177           148           150           148           150
BM_sinsp_split_stddev                                          +0.5116         +0.5154             1             2             1             2
BM_sinsp_split_cv                                              +0.4842         +0.4878             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.1026         +0.1027            56            62            56            62
BM_sinsp_concatenate_paths_relative_path_median                +0.1183         +0.1184            56            63            56            63
BM_sinsp_concatenate_paths_relative_path_stddev                +1.9357         +1.9408             1             3             1             3
BM_sinsp_concatenate_paths_relative_path_cv                    +1.6626         +1.6669             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0020         +0.0021            24            24            24            24
BM_sinsp_concatenate_paths_empty_path_median                   +0.0020         +0.0022            24            24            24            24
BM_sinsp_concatenate_paths_empty_path_stddev                   +0.6600         +0.6803             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       +0.6567         +0.6768             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0688         +0.0689            58            61            58            61
BM_sinsp_concatenate_paths_absolute_path_median                +0.0802         +0.0804            57            62            57            62
BM_sinsp_concatenate_paths_absolute_path_stddev                +7.8697         +7.8276             0             4             0             4
BM_sinsp_concatenate_paths_absolute_path_cv                    +7.2989         +7.2588             0             0             0             0

Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.26%. Comparing base (c0b1aea) to head (11442a7).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2397   +/-   ##
=======================================
  Coverage   77.26%   77.26%           
=======================================
  Files         227      227           
  Lines       30323    30323           
  Branches     4644     4644           
=======================================
  Hits        23429    23429           
  Misses       6894     6894           
Flag Coverage Δ
libsinsp 77.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

github-actions bot commented May 9, 2025

X64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN BPF-PROBE BUILD BPF-PROBE SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-4.19 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2-5.10 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2-5.15 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2-5.4 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2023-6.1 🟢 🟢 🟢 🟢 🟢 🟢
archlinux-6.0 🟢 🟢 🟢 🟢 🟢 🟢
archlinux-6.7 🟢 🟢 🟢 🟢 🟢 🟢
centos-3.10 🟢 🟢 🟢 🟡 🟡 🟡
centos-4.18 🟢 🟢 🟢 🟢 🟢 🟢
centos-5.14 🟢 🟢 🟢 🟢 🟢 🟢
fedora-5.17 🟢 🟢 🟢 🟢 🟢 🟢
fedora-5.8 🟢 🟢 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-3.10 🟢 🟢 🟢 🟡 🟡 🟡
oraclelinux-4.14 🟢 🟢 🟢 🟢 🟢 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-5.4 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-4.15 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-5.8 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-6.5 🟢 🟢 🟢 🟢 🟢 🟢

ARM64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN BPF-PROBE BUILD BPF-PROBE SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-5.4 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-4.14 🟢 🟢 🟢 🟡 🟡 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢 🟢 🟢
ubuntu-6.5 🟢 🟢 🟢 🟢 🟢 🟢

@poiana poiana added the lgtm label May 9, 2025
@github-project-automation github-project-automation bot moved this from Todo to In progress in Falco Roadmap May 9, 2025
@poiana poiana merged commit b1b10ef into master May 9, 2025
56 checks passed
@poiana poiana deleted the chore/limit_bpf_loop_16 branch May 9, 2025 08:11
@github-project-automation github-project-automation bot moved this from In progress to Done in Falco Roadmap May 9, 2025
@FedeDP FedeDP mentioned this pull request May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants