Bug 258535

Summary: /proc/self/oom_adj needs to use /proc/self/oom_score_adj
Product: [Unmaintained] kdelibs Reporter: David Rientjes <rientjes>
Component: kdeinitAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: david, faure, l.lunak, rientjes
Priority: NOR    
Version: 4.5   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In: 4.6.1
Sentry Crash Report:

Description David Rientjes 2010-12-02 02:57:06 UTC
Version:           unspecified (using KDE 4.5.3) 
OS:                Linux

/proc/self/oom_adj is deprecated in Linux 2.6.36 and later kernels; it
is scheduled for removal in August 2012.

start_kdeinit uses this interface to disable oom killing.

The new interface to use is /proc/self/oom_score_adj.  Instead of
writing -17 to /proc/self/oom_adj, sshd should now write -1000 to
/proc/self/oom_score_adj for the same behavior.

The filename and value written needs to be changed for 2.6.36 and later kernels.

Reproducible: Always

Steps to Reproduce:
Starting kde on 2.6.36 or later kernels will emit a warning message to the kernel log:

start_kdeinit (1502): /proc/1502/oom_adj is deprecated, please use /proc/1502/oom_score_adj instead.
Comment 1 Pino Toscano 2010-12-05 19:28:25 UTC
Lubos?
Comment 2 David Heidelberg 2010-12-22 12:17:48 UTC
I can confirm that on 4.6_beta2
Comment 3 support.intranet 2011-01-20 13:36:47 UTC
Confirmed here as well (4.5.5, linux 2.6.37)
Comment 4 David Rientjes 2011-01-26 11:09:45 UTC
This should be very easy to fix: if /proc/pid/oom_score_adj exists, set it to -1000 (OOM_SCORE_ADJ_MIN from linux/oom.h), otherwise set /proc/pid/oom_adj to -17 (OOM_DISABLE from linux/oom.h).
Comment 5 David Faure 2011-02-21 20:44:01 UTC
I just applied http://commits.kde.org/kdelibs/1bea60f843dfe098b1a411482b7e404bfe8a0e55 which fixes this, although it uses -300 rather than -1000; seems this was suggested by Novell guys, I don't know the exact reasoning.
Comment 6 David Faure 2011-02-21 20:51:38 UTC
Backported for 4.6.1 in e3b0aed5bf72858b772577f8b6688b9c7085bca2