From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Grubb Subject: Re: Fwd: Patch for using /proc/oom_score_adj with newer kernels Date: Mon, 9 May 2011 11:18:49 -0400 Message-ID: <201105091118.49654.sgrubb@redhat.com> References: <20110502230831.GA6875@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20110502230831.GA6875@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com List-Id: linux-audit@redhat.com On Monday, May 02, 2011 07:08:31 PM Tony Jones wrote: > I'm not sure what the policy is on moderator approval for posts. AJ sent > this a while ago and resent again on 4/27 (he is not subscribed, so both > times the post was waiting moderator approval). Anyone can CC me on a patch to make sure its gets through. > Anyways, we've had this patch in our OpenSuSE version for a while. Applied but with a change. > + /* Newer kernels (noticed in 2.6.36) */ > + oomfd = open("/proc/self/oom_score_adj", O_NOFOLLOW | O_WRONLY); > + if (oomfd >= 0) { > + (void)write(oomfd, "0", 1); This needs to be -1000 to have the same behavior as before. -Steve