Re: [why oom_adj does not work] Re: Linux killed Kenny, bastard!
From: Evgeniy Polyakov
Date: Tue Jan 13 2009 - 10:21:21 EST
On Tue, Jan 13, 2009 at 08:30:16PM +0530, Balbir Singh (balbir@xxxxxxxxxxxxxxxxxx) wrote:
> > It is created because of real needs. Because people need to control the
> > behaviour of the system and they want to control which application will
> > be killed to free the memory. Attached patch is not the best solution,
> > but it works for the all cases I can think about.
> >
>
> Where does this end? Tomorrow you'll add an interface for applications
> that should *not* be killed? What sort of a heuristic is name? I think
> the only name the kernel knows about is "init".
We have an interface to disable oom for the process already :)
But I could agree that it could be a good idea to have an interface
to provide a list of names or whatever else to select what user knows
and works with to be killed first/last
> > Let's take you 'name aliasing' claim: if there are several processes
> > with the same name, system will select the one with the worst score
> > according to the own magical algorithm. So it will not kill random
> > process just because it happend to have ricky name.
> >
>
> Having a name in the kernel is like building a hit-list, why can't the
> examples that Alan sent work for you?
Using oom_adj? Because there is no way I can determine which number to
put there. It is not even documented for those who do not read kernel
sources. Even after that: oom_score changes with time, and having 1/2 or
8 oom_adj is correct right now, it will not be in a few moments.
Having containers is a bit overkill to determine which one to kill,
especially when several sets of processes are created from the same
parent :)
> Names are tricky as well, if someone used a symbolic link to the
> application with a different name, they would no longer be candidates
> for OOM first? or vice-versa?
It is up to the user to decide what he wants to be checked first.
Only user knows what he runs.
> You can replace the lines of kernel code you wrote with a simple
> one-line script that Alan sent out.
Almost. But I can not if tasks are spawned from the parent process. We
can not change the process to adjust its forked children to have
different adjustment and can not change it for the process itself, since
it should live and children should be dead.
--
Evgeniy Polyakov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/