Re: /proc/self/oom_adj is deprecated in newer Linux kernels - Mailing list pgsql-hackers

From Tom Lane
Subject Re: /proc/self/oom_adj is deprecated in newer Linux kernels
Date
Msg-id 31652.1402416356@sss.pgh.pa.us
Whole thread Raw
In response to Re: /proc/self/oom_adj is deprecated in newer Linux kernels  (Gurjeet Singh <gurjeet@singh.im>)
Responses Re: /proc/self/oom_adj is deprecated in newer Linux kernels  (Gurjeet Singh <gurjeet@singh.im>)
List pgsql-hackers
Gurjeet Singh <gurjeet@singh.im> writes:
> On Tue, Jun 10, 2014 at 11:52 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Robert's idea of having the start script set an environment variable to
>> control the OOM adjustment reset seems like it would satisfy my concern.

> I'm fine with this solution. Should this be a constant 0, or be
> configurable based on env. variable's value?

If we're going to do this, I would say that we should also take the
opportunity to get out from under the question of which kernel API
we're dealing with.  So perhaps a design like this:

1. If the environment variable PG_OOM_ADJUST_FILE is defined, it's
the name of a file to write something into after forking.  The typical
value would be "/proc/self/oom_score_adj" or "/proc/self/oom_adj".
If not set, nothing happens.

2. If the environment variable PG_OOM_ADJUST_VALUE is defined, that's
the string we write, otherwise we write "0".
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Proposing pg_hibernate
Next
From: Robert Haas
Date:
Subject: Re: /proc/self/oom_adj is deprecated in newer Linux kernels