[PATCH 2/2] oom: give bonus to frozen processes

From: Michal Hocko
Date: Mon Sep 26 2011 - 04:36:01 EST


On Fri 26-08-11 11:13:40, David Rientjes wrote:
> On Fri, 26 Aug 2011, Michal Hocko wrote:
[...]
> > I am not saying the bonus is necessary, though. It depends on what
> > the freezer is used for (e.g. freeze a process which went wild and
> > debug what went wrong wouldn't welcome that somebody killed it or other
> > (mis)use which relies on D state).
[...]
> If it actually does come down to a heuristic change, then it need not
> happen in the oom killer: the freezing code would need to use
> test_set_oom_score_adj() to temporarily reduce the oom_score_adj for that
> task until it comes out of the refrigerator. We already use that in ksm
> and swapoff to actually prefer threads, but we can use it to bias against
> threads as well.

Let's try it with a heuristic change first. If you really do not like
it, we can move to oom_scode_adj. I like the heuristic change little bit
more because it is at the same place as the root bonus.
---