[olpc-software] graceful handling of out-of-memory conditions

Alan Cox alan at redhat.com
Tue Mar 28 10:22:48 UTC 2006


On Mon, Mar 27, 2006 at 09:36:07PM -0500, David Zeuthen 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

This is what "no overcommit" does. But if you want to avoid OOM killing you
must also handle "out of memory"

> 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?

I forget who answered this originally but something I'd missed is that
current 2.6 already exposes the needed variable.  /proc/$pid/oom_score allows 
prioritisation if you want to do OOM kills, but we will thrash the box pretty 
hard first I suspect.

> Of course, down the road we may add further things like instrumenting
> apps to deal with SIGDANGER or whatever signals from the kernel, save
> their session and automatically exit, cooperate with our WM, restore
> from hibernation etc. 

That requires you avoid OOM, once you hit OOM something has to die and
has to die immediately as I said earlier. 

Alan




More information about the olpc-software mailing list