Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 107C9B5DBC4 for ; Mon, 19 Sep 2011 05:26:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 53561-04 for ; Mon, 19 Sep 2011 08:25:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by mail.postgresql.org (Postfix) with SMTP id 45999B5DC13 for ; Mon, 19 Sep 2011 05:25:59 -0300 (ADT) Received: (qmail invoked by alias); 19 Sep 2011 08:25:55 -0000 Received: from fsgw.f-secure.com (EHLO [10.128.133.18]) [193.110.108.33] by mail.gmx.net (mp042) with SMTP; 19 Sep 2011 10:25:55 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX19nggZlzq9nVr1WPZC4Sdey2da81c9FqptWMVKcwC DSgge+0wH8sRX4 Subject: Re: /proc/self/oom_adj is deprecated in newer Linux kernels From: Peter Eisentraut To: Tom Lane Cc: pgsql-hackers@postgreSQL.org In-Reply-To: <15953.1316362868@sss.pgh.pa.us> References: <29121.1316185073@sss.pgh.pa.us> <1316355543.12186.9.camel@vanquo.pezone.net> <15953.1316362868@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Date: Mon, 19 Sep 2011 11:25:54 +0300 Message-ID: <1316420754.14001.3.camel@fsopti579.F-Secure.com> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.403 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/842 X-Sequence-Number: 195031 On sön, 2011-09-18 at 12:21 -0400, Tom Lane wrote: > Peter Eisentraut writes: > > On fre, 2011-09-16 at 10:57 -0400, Tom Lane wrote: > >> So it looks like it behooves us to cater for oom_score_adj in the > >> future. The simplest, least risky change that I can think of is to > >> copy-and-paste the relevant #ifdef code block in fork_process.c. > >> If we do that, then it would be up to the packager whether to #define > >> LINUX_OOM_ADJ or LINUX_OOM_SCORE_ADJ or both depending on the behavior > >> he wants. > > > There are lots of reasons why that won't work: backports, forward ports, > > derivatives, custom kernels, distribution upgrades, virtual hosting. > > [ shrug... ] These are all hypothetical reasons. A packager who > foresaw needing that could just turn on both write attempts, or for that > matter patch the code to do whatever else he saw fit. In practice, > we've not had requests for anything significantly smarter than what is > there. > > But having said that, it wouldn't be very hard to arrange things so that > if you did have both symbols defined, the code would only attempt to > write oom_adj if it had failed to write oom_score_adj; which is about as > close as you're likely to get to a kernel version test for this. Why is this feature not a run-time configuration variable or at least a configure option? It's awfully well hidden now. I doubt a lot of people are using this even though they might wish to.