Skip to content

Conversation

@rical
Copy link
Contributor

@rical rical commented Dec 8, 2025

Description

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.

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

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 <[email protected]>
Copy link

Copilot AI left a 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
Copy link

Copilot AI Jan 29, 2026

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.

Copilot uses AI. Check for mistakes.

## Memory

Default memory tuning is defined in `/etc/sysctl.d/vm.conf`, optimized for embedded network devices with 512MB-4GB RAM.
Copy link

Copilot AI Jan 29, 2026

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.

Copilot uses AI. Check for mistakes.

# OOM Behavior
# Panic on OOM for fast system reset and recovery
vm.panic_on_oom=1
Copy link

Copilot AI Jan 29, 2026

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.

Suggested change
vm.panic_on_oom=1
vm.panic_on_oom=1
# Automatically reboot 10 seconds after a kernel panic for deterministic recovery
kernel.panic=10

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants