Re: [PATCH v2]mm/oom-kill: direct hardware access processes should get bonus

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Rientjes
Date: Sunday, November 14, 2010 - 2:29 pm

On Sun, 14 Nov 2010, KOSAKI Motohiro wrote:


No, 3% was chosen in __vm_enough_memory() for LSMs as the comment in the 
oom killer shows:

        /*
         * Root processes get 3% bonus, just like the __vm_enough_memory()
         * implementation used by LSMs.
         */

and is described in Documentation/filesystems/proc.txt.

I think in cases of heuristics like this where we obviously want to give 
some bonus to CAP_SYS_ADMIN that there is consistency with other bonuses 
given elsewhere in the kernel.


The old heuristic divided the arbitrary badness score by 4 with 
CAP_SYS_RESOURCE.  The new heuristic doesn't consider it.

How is that more clean?


As a side-effect of being given more resources to allocate, those 
applications are relatively unbounded in terms of memory consumption to 
other tasks.  Thus, it's possible that these applications are using a 
massive amount of memory (say, 75%) and now with the proposed change a 
task using 25% of memory would be killed instead.  This increases the 
liklihood that the CAP_SYS_RESOURCE thread will have to be killed 
eventually, anyway, and the goal is to kill as few tasks as possible to 
free sufficient amount of memory.

Since threads having CAP_SYS_RESOURCE have full control over their 
oom_score_adj, they can take the additional precautions to protect 
themselves if necessary.  It doesn't need to be a part of the heuristic to 
bias these tasks which will lead to the undesired result described above 
by default rather than intentionally from userspace.


Then you would want to explicitly filter these tasks from oom kill just as 
OOM_SCORE_ADJ_MIN works rather than giving them a memory quantity bonus.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH v2]oom-kill: CAP_SYS_RESOURCE should get bonus, David Rientjes, (Wed Nov 3, 4:47 pm)
Re:[PATCH v2]oom-kill: CAP_SYS_RESOURCE should get bonus, David Rientjes, (Wed Nov 3, 6:50 pm)
Re: [PATCH v2]oom-kill: CAP_SYS_RESOURCE should get bonus, KOSAKI Motohiro, (Tue Nov 9, 4:01 am)
Re: [PATCH v2]oom-kill: CAP_SYS_RESOURCE should get bonus, David Rientjes, (Tue Nov 9, 2:06 pm)
Re: [PATCH v2]oom-kill: CAP_SYS_RESOURCE should get bonus, David Rientjes, (Tue Nov 9, 2:25 pm)
Re: [PATCH v2]oom-kill: CAP_SYS_RESOURCE should get bonus, David Rientjes, (Wed Nov 10, 1:50 pm)
Re: [PATCH v2]mm/oom-kill: direct hardware access processe ..., David Rientjes, (Sun Nov 14, 2:29 pm)
Re: [PATCH] Revert oom rewrite series, Figo.zhang, (Sun Nov 14, 8:26 pm)
Re: [PATCH] Revert oom rewrite series, David Rientjes, (Mon Nov 15, 3:14 am)
Re: [PATCH] Revert oom rewrite series, Alan Cox, (Mon Nov 15, 3:57 am)
Re: [PATCH] Revert oom rewrite series, David Rientjes, (Mon Nov 15, 1:54 pm)
Re: [PATCH] Revert oom rewrite series, KOSAKI Motohiro, (Tue Nov 23, 12:16 am)