Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 0A799FD3E1E for ; Tue, 12 Jun 2012 14:05:32 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SeUX5-0006F7-2U for pgsql-hackers@postgresql.org; Tue, 12 Jun 2012 17:05:31 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q5CH5Iko018876; Tue, 12 Jun 2012 13:05:18 -0400 (EDT) From: Tom Lane To: Robert Haas cc: pgsql-hackers@postgresql.org Subject: Re: /proc/self/oom_adj is deprecated in newer Linux kernels In-reply-to: References: <29121.1316185073@sss.pgh.pa.us> <18434.1339519058@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 12 Jun 2012 12:44:38 -0400" Date: Tue, 12 Jun 2012 13:05:18 -0400 Message-ID: <18875.1339520718@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/453 X-Sequence-Number: 209293 Robert Haas writes: > On Tue, Jun 12, 2012 at 12:37 PM, Tom Lane wrote: >> I still think it's sufficient to do what I suggested initially: >>> ... The simplest, least risky change that I can think of is to >>> copy-and-paste the relevant #ifdef code block in fork_process.c. > I think my position, and the position of the people who responded to > the original thread, was that it seems like you're architecting a > kludge when it wouldn't be that hard to architect a nicer solution. I'd be the first to agree it's a kluge. But the end result of the previous discussion was that it wasn't so obvious how to architect a nicer solution. Nor is there all that much room for people to use a nicer solution, given that we need help from not just fork_process.c but the root-privileged startup script (or lately in Fedora it's a systemd unit script doing the privilege-increasing end of this). In the short run, if we don't have consensus on this, I'll probably just carry a Fedora patch like so: - int fd = open("/proc/self/oom_adj", O_WRONLY, 0); + int fd = open("/proc/self/oom_score_adj", O_WRONLY, 0); But it seems a tad silly to be carrying such a patch for a block of code that is only of interest to Linux packagers anyway, and nearly all such packagers are facing this same issue either now or in the very near future. regards, tom lane