public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauricio Lin <mauriciolin@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Out of memory killer - time conditions before killing a process
Date: Thu, 2 Dec 2004 11:52:13 -0400	[thread overview]
Message-ID: <3f250c7104120207524399d522@mail.gmail.com> (raw)

Does anyone know why in the out_of_memory(int gfp_mask) function has
the following conditions:

	 * If it's been a long time since last failure,
	 * we're not oom.
	 */
	if (since > 5*HZ)
		goto reset;

	/*
	 * If we haven't tried for at least one second,
	 * we're not really oom.
	 */
	since = now - first;
	if (since < HZ)
		goto out_unlock;

	/*
	 * If we have gotten only a few failures,
	 * we're not really oom. 
	 */
	if (++count < 10)
		goto out_unlock;

These conditions prevent the oom_kill() function to be invoked. Could
anyone explain about it?
Why 5 seconds, count variable less than 10 ...?

BR,

Mauricio Lin.

                 reply	other threads:[~2004-12-02 15:53 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=3f250c7104120207524399d522@mail.gmail.com \
    --to=mauriciolin@gmail.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