Fwd: Patch for using /proc/<id>oom_score_adj with newer kernels

Steve Grubb sgrubb at redhat.com
Mon May 9 15:18:49 UTC 2011


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




More information about the Linux-audit mailing list