public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <willy@w.ods.org>
To: Al Boldi <a1426z@gawab.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	barryn@pobox.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] strict VM overcommit accounting for 2.4.32/2.4.33-pre1
Date: Sat, 31 Dec 2005 15:18:41 +0100	[thread overview]
Message-ID: <20051231141841.GA5879@w.ods.org> (raw)
In-Reply-To: <200512311702.20525.a1426z@gawab.com>

On Sat, Dec 31, 2005 at 05:02:20PM +0300, Al Boldi wrote:
> Willy Tarreau wrote:
(...)
> > As shown in my previous mail, it allows malloc() to return NULL. I've
> > also successfully verified that it allows mmap() to fail if there is
> > not enough memory. I disabled swap, and set the overcommit_ratio to 95
> > and could not kill the system. Above this, it becomes tricky. At 97, I
> > see the last malloc() calls take a very long time, and at 98, the
> > system still hangs. But 95% without swap seems stable here.
> 
> Thanks, for confirming this!  And I agree that this patch and 2.6 offer an 
> important and necessary workaround to inhibit OOM-killer, but it's no more 
> than a workaround.
> 
> And so the question remains:  Why should overcommit come into play at all 
> when dealing with physical RAM only?

It is very important when you have many processes wasting lots of unused
memory. For instance, when firefox allocates 10 MB and uses only 3, then
the remaining 7 MB can be used by another process. But if finally firefox
tries to use them, and there is no memory left, then chances are that some
processes will be killed. I believe the same problem happens after a fork()
because data gets COWed but I'm not certain about this.

I'd bet that using a heavy GUI under X with no swap an overcommit_ratio
set around 95%, you could get occasionnal malloc() failures. But once
again, I may be wrong.

> Shouldn't it be possible to disable overcommit completely, thus giving kswapd 
> a break from running wild trying to find something to swap/page, which is 
> the reason why the system gets unstable going over 95% in your example.

I think it's going unstable above 95% because there are lots of other
areas consuming memory. I don't know for example if dentry caches,
network buffers, various hash tables, etc... are accounted for.

> Thanks!
> 
> --
> Al

Willy


  reply	other threads:[~2005-12-31 14:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-30 20:06 [PATCH] strict VM overcommit accounting for 2.4.32/2.4.33-pre1 Al Boldi
2005-12-30 20:18 ` Barry K. Nathan
2005-12-30 20:51   ` Al Boldi
2005-12-30 21:44     ` Willy TARREAU
2005-12-31  0:55 ` Alan Cox
2005-12-31  4:59   ` Al Boldi
2005-12-31  7:38     ` Willy Tarreau
2005-12-31 14:02       ` Al Boldi
2005-12-31 14:18         ` Willy Tarreau [this message]
2005-12-31 14:26         ` Arjan van de Ven
2005-12-31 14:58           ` Willy Tarreau
2005-12-31 15:17             ` Arjan van de Ven
2005-12-31 17:36           ` Al Boldi
2006-01-01  9:12             ` Arjan van de Ven
  -- strict thread matches above, loose matches on Subject: below --
2005-12-30  7:44 Barry K. Nathan
2005-12-30 17:48 ` Willy Tarreau
2005-12-30 18:17   ` Arjan van de Ven
2005-12-30 18:33     ` Willy Tarreau
2005-12-30 19:37       ` Barry K. Nathan
2005-12-30 20:45         ` Willy Tarreau

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=20051231141841.GA5879@w.ods.org \
    --to=willy@w.ods.org \
    --cc=a1426z@gawab.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=barryn@pobox.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