Re: [PATCH 5/6] oom: don't kill random process

From: David Rientjes
Date: Wed Jun 22 2011 - 19:22:27 EST


On Wed, 22 Jun 2011, KOSAKI Motohiro wrote:

> CAI Qian reported oom-killer killed all system daemons in his
> system at first if he ran fork bomb as root. The problem is,
> current logic give them bonus of 3% of system ram. Example,
> he has 16GB machine, then root processes have ~500MB oom
> immune. It bring us crazy bad result. _all_ processes have
> oom-score=1 and then, oom killer ignore process memroy usage
> and kill random process. This regression is caused by commit
> a63d83f427 (oom: badness heuristic rewrite).
>

Isn't it better to give admin processes a proportional bonus instead of a
strict 3% bonus? I suggested 1% per 10% of memory used earlier and I
think it would work quite well as an alternative to this. The highest
bonus that would actually make any differences in which thread to kill
would be 5% when an admin process is using 50% of memory: in that case,
another non-admin thread would have to be using >45% of memory to be
killed instead.

Would you be satisfied with something like

points -= (points * 10 / totalpages);

be better?
--
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/