From: Jeff Davis <linux@j-davis.com>
To: linux-kernel@vger.kernel.org
Subject: oom_kill.c badness() correction for shared memory
Date: Fri, 09 Feb 2007 10:34:15 -0800 [thread overview]
Message-ID: <1171046056.10824.71.camel@dogma.v10.wvs> (raw)
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
parent.
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
consumption.
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
parent.
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
times).
Regards,
Jeff Davis
reply other threads:[~2007-02-09 19:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1171046056.10824.71.camel@dogma.v10.wvs \
--to=linux@j-davis.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®