Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 8C93BB5DC5C for ; Fri, 16 Sep 2011 11:57:59 -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 61338-07 for ; Fri, 16 Sep 2011 14:57:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 47FBEB5DC2A for ; Fri, 16 Sep 2011 11:57:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p8GEvrJr029122 for ; Fri, 16 Sep 2011 10:57:53 -0400 (EDT) To: pgsql-hackers@postgreSQL.org Subject: /proc/self/oom_adj is deprecated in newer Linux kernels Date: Fri, 16 Sep 2011 10:57:53 -0400 Message-ID: <29121.1316185073@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/795 X-Sequence-Number: 194984 While testing 9.1 RPMs on Fedora 15 (2.6.40 kernel), I notice messages like these in the kernel log: Sep 11 13:38:56 rhl kernel: [ 415.308092] postgres (18040): /proc/18040/oom_adj is deprecated, please use /proc/18040/oom_score_adj instead. These don't show up on every single PG process launch, but that probably just indicates there's a rate-limiter in the kernel reporting mechanism. 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. That would be good enough for my own purposes in building Fedora/RHEL packages, since I can predict with confidence which kernel versions a given build is likely to be used with. I think probably the same would be true for most other distro-specific builds. Does anyone want to argue for doing something more complicated, and if so what exactly? regards, tom lane