oom killer in 2.4.23
I would appreciate if someone could answer the following question:
obviously oom killer has been removed from 2.4.23. the result is _bad_ in my special environment. (xserver gets killed instead of application)
i'm sure you had very good reasons for removing the oom killer.
nevertheless i've seen, that oom_kill.c is still in mm/ but disabled with #if 0
and out_of_memory() is not called anymore from vmscan.c.
is it sufficient to remove the #if 0 from oom_kill.c, call out_of_memory() fromvmscan.c again and add PF_MEMDIE to sched.h in order to get the "old" behaviour ?
or will this result in - i don't know - something horrible?
thanks for your help!
cheers,
pet
(please cc me as i'm not (yet) subscribed.)
Signature · 2 lines
+++ GMX - die erste Adresse für Mail, Message, More +++ Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
Yes, and as a side question, couldn't oom killer be made into a config option?
Cheers,
MaZe.
Quoted 2 lines
Yes, and as a side question, couldn't oom killer be made into a config option?
As I see in the ChangeLog:
aa VM merge: page reclaiming logic changes: Kills oom killer
OOM Killer has been removed due to AA VM changes, so maybe it can't be cleanly enabled again.
Regards,
Guillermo.
Signature · 3 lines
Usuario Linux #212057 - Maquinas Linux #98894, #130864 y #168988 Proyecto LONIX: http://lonix.sourceforge.net Lagrimas en la Lluvia: http://www.lagrimasenlalluvia.com
Quoted 9 lines · Guillermo Menguez Alvarez
Quoted 2 lines
Yes, and as a side question, couldn't oom killer be made into a config option?
As I see in the ChangeLog:
aa VM merge: page reclaiming logic changes: Kills oom killer
OOM Killer has been removed due to AA VM changes, so maybe it can't be cleanly enabled again.
it can be re-enabled without too much pain if you can accept the desktop behaviour of 2.4.22 and previous not suitable for servers.
the oom killer had deadlocks and it was relaying on very inaccurate accounting, so it had a number of corner cases were it was killing tasks by mistakes (it's fooled by shm/mlock/noswap etc..), read also the bugreports for 2.4.22 with tasks being killed because there was no swap in the box (or just try to run your machine w/o swap, swap is not a must, it's a wish). Fixing those in 2.4 sounds too complicated, and now it's too late to even hope to make a proper oom killer for 2.4.
For the record 2.2 was capable of checking iopl to defer a few times the killing of the X server, that wasn't forward ported to 2.4. For 2.6 we can do something better than all the past oom killers at least. 2.6 gets fooled by mlock too btw, ranom kill tasks etc.. so it's not much better than 2.4.22 was in oom killing respect.
Quoted 6 lines
Yes, and as a side question, couldn't oom killer be made into a config option?
Cheers,
MaZe.
I just tried it and - no it does not work.
At least not with the following changes:
added #define PF_MEMDIE 0x00001000 to sched.h
replaced oom_kill.c with the 2.4.22 version
added out_of_memory() to the end of try_to_free_pages_zone()
replaced if (current->flags & PF_MEMALLOC && !in_interrupt()) { with
replaced if ((current->flags & (PF_MEMALLOC | PF_MEMDIE)) && !in_interrupt() ) {
in page_alloc.c
effect is still unchanged.
processes get killed by VM and not oom_kikll.c
any hints ??
Signature · 2 lines
+++ GMX - die erste Adresse für Mail, Message, More +++ Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
Quoted 23 lines · Peter Bergmann
Quoted 6 lines
Yes, and as a side question, couldn't oom killer be made into a config option?
Cheers,
MaZe.I just tried it and - no it does not work.
At least not with the following changes:added #define
PF_MEMDIE0x00001000tosched.hreplaced
oom_kill.cwith the 2.4.22 versionadded
out_of_memory()to the end oftry_to_free_pages_zone()replaced if (
current->flags&PF_MEMALLOC&& !in_interrupt()) { with
replaced if ((current->flags& (PF_MEMALLOC|PF_MEMDIE)) && !in_interrupt() ) {
inpage_alloc.c
Quoted 4 lines
effect is still unchanged.
processes get killed by VM and notoom_kikll.cany hints ??
You probably want to look at the change to
vmscan.c:try_to_free_pages_zone().
Signature · 1 line
Jens Axboe
Quoted 10 lines
Quoted 4 lines
effect is still unchanged.
processes get killed by VM and notoom_kikll.cany hints ??
You probably want to look at the change to
vmscan.c:try_to_free_pages_zone().Signature · 1 line
Jens Axboe
I did, but my vm knolege is rather limited.
I don't really know really know _where_ to place out_of_memory() in the new try_to_free_pages_zone()... and what other changes would be necessary in vmscan.c.
My try & error approach did not succeed.
I would be really glad if someone (aa may be :) could provide the information where/how to place the call for a custom (or the old) oom killer - if it's really that simple ...
cheers,
pet
Signature · 2 lines
+++ GMX - die erste Adresse für Mail, Message, More +++ Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
Quoted 3 lines · Peter Bergmann
I would be really glad if someone (aa may be :) could provide the information where/how to place the call for a custom (or the old) oom killer - if it's really that simple ...
In the 2.2 backport I called it from the page fault handler,
http://mlf.linux.rulez.org/mlf/ezaz/reserved_root_memory.html
It worked fine for 2.2 but I don't know the current 2.4 VM state (without the oom killer it's just running amok, as you experienced).
Szaka
Quoted 16 lines · Peter Bergmann
Quoted 10 lines
Quoted 4 lines
effect is still unchanged.
processes get killed by VM and notoom_kikll.cany hints ??
You probably want to look at the change to
vmscan.c:try_to_free_pages_zone().Signature · 1 line
Jens AxboeI did, but my vm knolege is rather limited.
I don't really know really know _where_ to placeout_of_memory()in the newtry_to_free_pages_zone()... and what other changes would be necessary invmscan.c.
Quoted 5 lines
My try & error approach did not succeed.
I would be really glad if someone (aa may be :) could provide the information where/how to place the call for a custom (or the old) oom killer - if it's really that simple ...
it's that simple to reenable it in 2.4.22 status, so if you're ok to deadlock. 2.4.23 can't deadlock, it can live lock if you're unlucky with timings yes (think if you add 32G of swap and your ram runs at 1k/sec instead of 1G/sec), but not deadlock and it won't random kill tasks even if it shouldn't to. deadlock is a bug, killing task despite there's ram free is a bug, livelock is something you can avoid by dropping all swap. if you drop all swap with 2.4.22 it'll go nuts killing tasks (see the bugreports).
Since doing it right wasn't possible in 2.4, I dropped it years ago, -aa users are w/o an oom killer for years and I never heard a single complain. somebody asked why yes, but they were happy afterwards. I don't think I asked Marcelo to merge it, I explained why I dropped it, people sent him bugreports about the oom killer going nuts, and he agreed my solution was the best short term w/o adding lots of effort to make the oom killer right. Note the oom killer goes nuts in 2.6 too, nobody did it right yet, that's why I don't think it's a 2.4 issue.
Marcelo asked me to to make it configurable at runtime so you could go in the deadlock prone stautus of 2.4.22 on demand, but I'm not going to add more features to 2.4 today unless they're blocker bugs (even if that would be simple to implement), actually it's not even my choice so don't ask me for that sorry.