[lkml]   [2007]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectoom_kill.c badness() correction for shared memory

In oom_kill.c, badness() takes into account many factors, including half
the total_vm of all the children.

The problem with this calculation is that, if the parent and children
share memory, the shared memory segment is counted many times for the

I don't think we need to count the shared memory at all when calculating
badness, because there's already a hard limit on the amount of shared
memory, so it's unlikely that process is runaway due to shared memory

Would it be better to just use (total_vm-shared_vm) in the badness
function in each instance it currently uses total_vm? At a minimum, we
should do that for the loop that counts each child's vm against the

An example of a practical problem is with PostgreSQL. PostgreSQL
installations often have very large shared memory regions shared between
the parent and all the child processes. If the OOM killer is invoked,
it's almost guaranteed to kill the PostgreSQL parent process first, even
if the PostgreSQL processes all combined use much less memory than the
"real" bad process (because the same shared memory is counted many

Jeff Davis

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-02-09 20:03    [W:0.029 / U:1.876 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site