Page MenuHomeFreeBSD

vm_pageout_oom(): Allow the option (via sysctl) of panic'ing instead of killing a process when required.
ClosedPublic

Authored by will on Jan 23 2015, 11:46 PM.

Details

Reviewers
kib
alc
Summary

This sysctl enables those who would rather panic than kill a process, when the system runs out of memory. Usually, this is most useful when the OOM condition is due to mismanagement of memory, on a system where the applications in question don't respond well to being killed.

In theory, if the system is properly managed, it shouldn't be possible to hit this condition. If it does, the panic can be more desirable for some users (since it can be a good means of finding the root cause) rather than killing the largest process and continuing on its merry way.

Test Plan

Install kernel, sysctl vm.panic_on_oom=1, run the system out of memory. Any further testing that could be done is contingent on the specific situation; this is primarily a development/debugging tool.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

will updated this revision to Diff 3376.Jan 23 2015, 11:46 PM
will retitled this revision from to vm_pageout_oom(): Allow the option (via sysctl) of panic'ing instead of killing a process when required..
will updated this object.
will edited the test plan for this revision. (Show Details)
will added reviewers: kib, alc.
will set the repository for this revision to rS FreeBSD src repository.
kib accepted this revision.Jan 24 2015, 11:26 AM
kib edited edge metadata.
This revision is now accepted and ready to land.Jan 24 2015, 11:26 AM
kib added a comment.Jan 24 2015, 11:41 AM

There is also protect(1) tool, which uses procctl(PROC_SPROTECT) to ensure that some processes are immune to OOM. Still, I think that panic() option is useful in some environments.

alc edited edge metadata.Jan 24 2015, 5:58 PM

I see that you've already committed this, which is fine. For the record, I have no objections to this change.

alc accepted this revision.Jan 24 2015, 6:00 PM
alc edited edge metadata.
will closed this revision.May 7 2017, 6:17 AM