Skip to content
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

armbian-kernel.sh: introduce KERNEL_BTF=no to opt-out of BTF/CO-RE type-info on low-RAM machines #7675

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rpardini
Copy link
Member

@rpardini rpardini commented Jan 8, 2025

armbian-kernel.sh: introduce KERNEL_BTF=no to opt-out of BTF/CO-RE type-info on low-RAM machines

  • armbian-kernel.sh: introduce KERNEL_BTF=no to opt-out of BTF/CO-RE type-info on low-RAM machines
    • turns out pahole for vmlinux can take multiple gigabytes of RAM to run successfully
    • I can't simply decide based on available RAM, as that would make .config hashes mismatch
    • thus, introduce:
      • default is to enable BTF; if on low-ram host, error out unless KERNEL_BTF=yes is passed
      • if KERNEL_BTF=no is passed, the BTF debug info is always disabled
      • if KERNEL_BTF=yes is passed, then a warning is produced, but BTF is still enabled
    • the magic number "6451 MiB" was determined empirically (and is probably bs)

@github-actions github-actions bot added size/medium PR with more then 50 and less then 250 lines Needs review Seeking for review Framework Framework components labels Jan 8, 2025
@rpardini rpardini force-pushed the pr/armbian-kernelsh-introduce-KERNELBTFno-to-opt-out-of-BTFCO-RE-type-info-on-low-RAM-machines branch from 4092bf5 to ab6192d Compare January 23, 2025 19:02
@rpardini rpardini marked this pull request as ready for review January 23, 2025 19:02
@rpardini rpardini requested a review from a team as a code owner January 23, 2025 19:02
@rpardini rpardini mentioned this pull request Jan 23, 2025
7 tasks
@igorpecovnik igorpecovnik added the Needs Documentation New feature needs documentation entry label Jan 23, 2025
…type-info on low-RAM machines

- turns out `pahole` for `vmlinux` can take multiple gigabytes of RAM to run successfully
- I can't simply decide based on available RAM, as that would make .config hashes mismatch
- thus, introduce:
  - default is to enable BTF; if on low-ram host, error out unless KERNEL_BTF=yes is passed
  - if KERNEL_BTF=no is passed, the BTF debug info is always disabled
  - if KERNEL_BTF=yes is passed, then a warning is produced, but BTF is still enabled
- the magic number "6451 MiB" was determined empirically (and is probably bs)
@rpardini rpardini force-pushed the pr/armbian-kernelsh-introduce-KERNELBTFno-to-opt-out-of-BTFCO-RE-type-info-on-low-RAM-machines branch from ab6192d to cf72bb4 Compare January 26, 2025 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Framework components Needs Documentation New feature needs documentation entry Needs review Seeking for review size/medium PR with more then 50 and less then 250 lines
Development

Successfully merging this pull request may close these issues.

2 participants