Re: [PATCH] oom: create a resource limit for oom_adj
From: David Rientjes
Date: Thu Nov 11 2010 - 18:22:02 EST
On Fri, 12 Nov 2010, Bodo Eggert wrote:
> The original oom_adj design would e.g. adjust all background tabs to seem
> twice as bad as the current tab, so a ever-growing current tab would
> only be able to get one or two tabs killed in the worst case:
>
> System is near OOM while the current tab starts using a normal amount of
> mem and grows beyond limits. After it easily killed the first bg tab by
> allocating one byte, it needs to grow to twice the normal tab memsize to
> start the OOM killer again. By then, it's score will be equal to normal
> background tabs (half size, double score), and killing the second tab will
> be luck. Killing the third tab should be impossible.
>
> (If you adjust the bg tabs to be four times as killable, you'll get what
> you asked for.)
>
>
> I don't know the current oom_score_adj, it should be able to do something
> similar? Or should there be a oom_score_mul?
>
oom_score_adj is done on a linear scale instead of exponential so instead
of increasing oom_adj by 1 for each hop to the current tab, you would need
to double it.
--
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/