Bug 211860

Summary: keep display alive after oom
Product: [openSUSE] openSUSE 10.2 Reporter: Olaf Hering <ohering>
Component: InstallationAssignee: Marcus Schaefer <ms>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: ms
Version: Alpha 5   
Target Milestone: ---   
Hardware: PowerPC   
OS: Linux   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Olaf Hering 2006-10-12 09:31:00 UTC
the kernel tends to kill processes that dont behave and use too much memory. see bug #209424

Unfortunatelty, the kernel kills also Xorg, which can not restore the graphics card state. If Xorg is killed, the system appears to be frozen.

echo -n '-17' > /proc/$XORG_PID/oom_adj 

In theory the line above should keep X alive, bug #211859 talks about the practice.
Either way, the yast startup scripts in the inst-sys have to make sure that Xorg is not killed.

Documentation/filesystems/proc.txt:
....
2.12 /proc/<pid>/oom_adj - Adjust the oom-killer score
------------------------------------------------------

This file can be used to adjust the score used to select which processes
should be killed in an  out-of-memory  situation.  Giving it a high score will
increase the likelihood of this process being killed by the oom-killer.  Valid
values are in the range -16 to +15, plus the special value -17, which disables
oom-killing altogether for this process.

2.13 /proc/<pid>/oom_score - Display current oom-killer score
-------------------------------------------------------------

------------------------------------------------------------------------------
This file can be used to check the current score used by the oom-killer is for
any given <pid>. Use it together with /proc/<pid>/oom_adj to tune which
process should be killed in an out-of-memory situation.
...
Comment 1 Marcus Schaefer 2006-10-13 13:43:35 UTC
something for Stefan I think
Comment 2 Stefan Dirsch 2006-10-16 01:46:54 UTC
> Either way, the yast startup scripts in the inst-sys have to make sure that
> Xorg is not killed.
Assigning back to Marcus therefore.
Comment 3 Marcus Schaefer 2006-10-16 09:19:15 UTC
*hups* sorry yes this is my bug. 

fixed

Index: startup/YaST2.call
===================================================================
--- startup/YaST2.call  (revision 33418)
+++ startup/YaST2.call  (revision 33420)
@@ -58,6 +58,8 @@
                                server_running=0
                                break;
                        fi
+                       # server is running, detach oom-killer from it
+                       echo -n '-17' > /proc/$xserver_pid/oom_adj
                        server_running=1
                        break
                fi