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

ffiselect: Set /proc/pid/oom_score_adj=900 for non-PoSt tasks (#329) #349

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

Conversation

HiberNuts
Copy link

Description

This PR implements OOM (Out Of Memory) score adjustment for non-PoSt tasks as requested in #329.

Changes

  • Added set_oom_score_adj utility function in src/utils/oom.rs
  • Modified task spawning in src/ffiselect/mod.rs to set high OOM scores (900) for non-PoSt tasks
  • Added appropriate error handling and logging

Implementation Details

  • Non-PoSt tasks are assigned an OOM score of 900, making them more likely to be killed under memory pressure
  • PoSt tasks retain their default OOM score to ensure their critical operations aren't interrupted
  • Failed OOM score adjustments are logged but don't interrupt task execution

Benefits

  1. Protects the main process from OOM kills
  2. Preserves other critical system processes (Lotus, yugabyte)
  3. Provides better handling of memory pressure situations
  4. Maintains system stability when memory usage exceeds expectations

Testing

  • Tested on Linux systems with procfs
  • Verified OOM score adjustment for both PoSt and non-PoSt tasks
  • Confirmed proper error handling when permission issues occur

Fixes #329

@LexLuthr
Copy link
Contributor

Please post the testing process and results here.

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.

ffiselect: Set /proc/../oom_score_adj
2 participants