/proc/self/oom_adj is deprecated in Linux 2.6.36 and later kernels; it is scheduled for removal in August 2012. sshd 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 OOM_ADJ_NOKILL needs to be changed in openbsd-compat/port-linux.c for 2.6.36 and later kernels.
Created attachment 1957 [details] openssh-linux-new-oomkill.patch Try new OOM interface first then fall back if necessary. Tested only on 2.6.32.
Comment on attachment 1957 [details] openssh-linux-new-oomkill.patch Works for me (2.6.32) but it would be nice if someone with a 2.6.36+ kernel could confirm it behaves as expected on that too.
ping: Darren's patch can't go in until someone with a 2.6.36 system tests his patch.
(In reply to comment #3) > ping: Darren's patch can't go in until someone with a 2.6.36 system > tests his patch. Tested on 2.6.36-ck5-r5 x86_64 openssh-5.6_p1 Error is gone from dmesg when restarting sshd. value of /proc/$PID/oom_score_adj is -1000 value of /proc/$PID/oom_adj is -17
your oom_adjust should be static and constant, and you should be using ARRAY_SIZE() instead of "2"
The idiom we use is to have a sentinel array entry with an obvious NULL or -1 somewhere we can test for: for (i = 0; whatever[i].fnord != NULL; i++) ...
Created attachment 1980 [details] Switched to end-of-array sentinel. fair comments, I've changed it to use the sentinel since that's consistent with what we do elsewhere.
Thanks, this has been committed and will be in 5.7p1.
Move resolved bugs to CLOSED after 5.7 release