Re: /proc/self/oom_adj is deprecated in newer Linux kernels

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Christoph Berg <cb(at)df7cb(dot)de>, Gurjeet Singh <gurjeet(at)singh(dot)im>, Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: /proc/self/oom_adj is deprecated in newer Linux kernels
Date: 2014-07-01 20:51:45
Message-ID: 20654.1404247905@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Tue, Jul 1, 2014 at 8:22 AM, Christoph Berg <cb(at)df7cb(dot)de> wrote:
>> I have two comments on the patch:
>>
>> The choice to make the behavior depend first on PG_OOM_ADJUST_FILE and
>> only secondly on PG_OOM_ADJUST_VALUE seems the wrong way round to me.

> Of course, we have no guarantee that the Linux kernel guys won't
> change this again. Apparently "we don't break userspace" is a
> somewhat selectively-enforced principle.

Yeah, I'm unexcited about this proposal. In any case, given the two
existing APIs we have to deal with, allowing PG_OOM_ADJUST_VALUE to
default to "0" is sane in both APIs but a default for the file name
can work for only one.

>> The other bit is the non-deprecation of OOM_ADJ in
>> contrib/start-scripts/linux. It took me a while to understand the
>> logic of the variables used there - the interface would be much
>> clearer if it just was like this:
>> ... and then use PG_OOM_ADJUST_FILE below instead of manually figuring
>> out which proc file to write to by looking at OOM.*_ADJ.

> I can't help but agree with this, though.

Fair enough. I went for a minimum-change approach when hacking that
script, but we could change it some more in the name of readability.
Will do something about that.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-07-01 20:54:35 Re: Spinlocks and compiler/memory barriers
Previous Message Abhijit Menon-Sen 2014-07-01 20:17:05 Re: change alter user to be a true alias for alter role