Re: [PATCH 1/5] staging: android: lowmemorykiller: Add config option to support oom_adj values

Arve Hjønnevåg
2013-02-27T23:47:19Z

On Wed, Feb 27, 2013 at 3:12 PM, David Rientjes <rientjes@google.com> wrote:
> On Wed, 27 Feb 2013, Arve Hjønnevåg wrote:
>
>> > Umm, writes to /proc/pid/oom_adj already are converted to the
>> > /proc/pid/oom_score_adj scale linearly. Heavy NACK to this patch since
>> > oom_adj is completely deprecated.
>>
>> I know it is deprecated, but your change, staging: android,
>> lowmemorykiller: convert to use oom_score_adj, broke existing
>> user-space code that still write to /proc/pid/oom_adj. This option
>> lets you build a kernel that supports our user-space code until that
>> user-space has been converted to use /proc/pid/oom_score_adj.
>>
>
> As stated, writes to /proc/pid/oom_adj already are converted to a linear
> scale and stored in /proc/pid/oom_score_adj. This is done with
>
> oom_adj == 15 -> oom_score_adj = 1000
> oom_adj != 15 -> oom_score_adj = (oom_adj * -1000) / -17
>
> since the maximum oom_score_adj is 1000 and the minimum oom_adj is -17.
>
> How does this not work as needed?

Because, without this patch, the values written to
/sys/module/lowmemorykiller/parameters/adj do not get adjusted and
therefore do not match the correct processes.

--
Arve Hjønnevåg