-
Notifications
You must be signed in to change notification settings - Fork 15
Tune kernel memory settings #1315
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
base: main
Are you sure you want to change the base?
Conversation
Add vm.conf with sysctl parameters optimized for embedded network devices 512MB-8GB of memory. Focus on fast recovery and determinism. - Panic on OOM - Aggressive dirty page writeback - Increased watermark scale factor for proactive reclaim Includes tuning guide documentation for alternative scenarios. Signed-off-by: Richard Alpe <richard@bit42.se>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds kernel memory tuning configuration optimized for embedded network devices with limited memory (512MB-4GB RAM). The configuration focuses on aggressive dirty page writeback and OOM panic behavior to ensure deterministic recovery on memory-constrained systems.
Changes:
- Add sysctl configuration for memory management with aggressive dirty page limits and OOM panic behavior
- Add comprehensive tuning guide documentation with alternative configurations for different system profiles
- Update ChangeLog and documentation index
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| board/common/rootfs/etc/sysctl.d/vm.conf | New sysctl configuration file with memory tuning parameters for embedded devices |
| doc/system-tuning.md | New documentation guide with memory tuning recommendations for different system profiles |
| doc/ChangeLog.md | Added entry documenting the new memory tuning feature |
| mkdocs.yml | Added system tuning guide to Developer's Corner navigation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,23 @@ | |||
| # Memory and OOM tuning for embedded network devices | |||
| # Optimized for systems with 512MB-4GB RAM | |||
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description states the configuration is "optimized for embedded network devices 512MB-8GB of memory" but this file states "512MB-4GB RAM". This inconsistency should be resolved. Based on the documentation file which also mentions "512MB-4GB RAM" and provides separate guidance for "4GB+ Memory", the configuration file appears correct and the PR description may need updating.
|
|
||
| ## Memory | ||
|
|
||
| Default memory tuning is defined in `/etc/sysctl.d/vm.conf`, optimized for embedded network devices with 512MB-4GB RAM. |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description states the configuration is "optimized for embedded network devices 512MB-8GB of memory" but this documentation states "512MB-4GB RAM". This inconsistency should be resolved. Based on the configuration file comments and the fact that this documentation provides separate guidance for "4GB+ Memory", the documentation appears correct and the PR description may need updating.
|
|
||
| # OOM Behavior | ||
| # Panic on OOM for fast system reset and recovery | ||
| vm.panic_on_oom=1 |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting vm.panic_on_oom=1 will cause a kernel panic on OOM, but without also setting kernel.panic to a non-zero value (e.g., kernel.panic=10), the system will hang at the panic screen rather than automatically rebooting. For "fast system reset and recovery" as stated in the comments and PR description, consider adding kernel.panic=10 (or similar value) to enable automatic reboot after a panic. This would complete the "deterministic recovery" behavior.
| vm.panic_on_oom=1 | |
| vm.panic_on_oom=1 | |
| # Automatically reboot 10 seconds after a kernel panic for deterministic recovery | |
| kernel.panic=10 |
Description
Add vm.conf with sysctl parameters optimized for embedded network devices 512MB-8GB of memory.
Focus on fast recovery and determinism.
Includes tuning guide documentation for alternative scenarios.
Checklist
Tick relevant boxes, this PR is-a or has-a: