[olpc-software] graceful handling of out-of-memory conditions
Jaya Kumar
jayakumar.lkml at gmail.com
Tue Mar 28 07:46:58 UTC 2006
On 3/28/06, David Zeuthen <davidz at redhat.com> wrote:
> I guess I'm just trying to say that... by default processes should be
> protected from being nuked by the OOM killer in the kernel. When our
> shell launches an application such as Firefox or Abiword it should
> simply set a flag for that process such that the OOM killer in the
- any process on the system can be protected from the
OOM killer by using /proc/pid/oom_adj and setting it to -17
(OOM_DISABLE)
> kernel may nuke it. Child processes should inherit this flag of course.
- children currently inherit the oom disable flag.
> Hence, only apps that are not part of the "shell" may get nuked and this
> should be sufficient as we already verified (through QA and testing)
> that our shell isn't leaking.
>
> What about this simple low-tech solution? If it's not 100% stupid, I
> suppose the next question is 1) what kernel changes are necessary; and
> 2) can we expect the Linux kernel people to accept such a patch
> upstream?
- oom killer selects the pid to murder by picking the pid that has the
highest mem size ( mm->total_mm + (all of it's children's mem size/2))
- long running + if_niced. this sounds nice and intuitive to me.
- the core oom killer function is badness() here
http://sosdg.org/~coywolf/lxr/source/mm/oom_kill.c#L46
I think the kernel already gives you the capability you request, right?
Best regards,
jaya kumar
More information about the olpc-software
mailing list