[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YPEW3H+W/uiRYIfn@dhcp22.suse.cz>
Date: Fri, 16 Jul 2021 07:19:24 +0200
From: Michal Hocko <mhocko@...e.com>
To: minyard@....org
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Corey Minyard <cminyard@...sta.com>
Subject: Re: [PATCH] oom_kill: oom_score_adj broken for processes with small
memory usage
On Thu 01-07-21 07:54:30, minyard@....org wrote:
> From: Corey Minyard <cminyard@...sta.com>
>
> If you have a process with less than 1000 totalpages, the calculation:
>
> adj = (long)p->signal->oom_score_adj;
> ...
> adj *= totalpages / 1000;
>
> will always result in adj being zero no matter what oom_score_adj is,
> which could result in the wrong process being picked for killing.
>
> Fix by adding 1000 to totalpages before dividing.
Yes, this is a known limitation of the oom_score_adj and its scale.
Is this a practical problem to be solved though? I mean 0-1000 pages is
not really that much different from imprecision at a larger scale where
tasks are effectively considered equal.
I have to say I do not really like the proposed workaround. It doesn't
really solve the problem yet it adds another special case.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists