linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Chris Friesen <chris.friesen@genband.com>
Cc: Bryan Donlan <bdonlan@gmail.com>,
	Pavel Ivanov <paivanof@gmail.com>,
	Denys Vlasenko <vda.linux@googlemail.com>,
	Mahmood Naderan <nt_mahmood@yahoo.com>,
	David Rientjes <rientjes@google.com>,
	Randy Dunlap <rdunlap@xenotime.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: running of out memory => kernel crash
Date: Fri, 19 Aug 2011 22:38:10 +0100	[thread overview]
Message-ID: <20110819223810.0f02016e@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <4E4ED366.1090104@genband.com>

> Indeed.  From the point of view of the OS, it's running everything on 
> the system without a problem.  It's deep into swap, but it's running.

Watchdogs can help here

> If there are application requirements on grade-of-service, it's up to 
> the application to check whether those are being met and if not to do 
> something about it.

Or it can request such a level of service from the kernel using the
various memory control interfaces provided but not enabled by
distributors in default configurations.

In particular you can tell the kernel to stop the system hitting the
point where it runs near to out of memory + swap and begins to thrash
horribly. For many workloads you will need a lot of pretty much excess
swap, but disk is cheap. It's like banking, you can either pretend it's
safe in which case you do impressions of the US banking system now and
then and the government has to reboot it, or you can do traditional
banking models where you have a reserve which is sufficient to cover the
worst case of making progress. Our zero overcommit isn't specifically
aimed at the page rate problem but is sufficiently related it usually
does the trick.

http://opsmonkey.blogspot.com/2007/01/linux-memory-overcommit.html

I would btw disagree strongly that this is a 'sorry we can't help'
situation. Back when memory was scarce and systems habitually ran at high
memory loads 4.2 and 4.3BSD coped just fine with very high fault rates
that make modern systems curl up and die. That was entirely down to
having good paging and swap policies linked to scheduling behaviour so
they always made progress. Your latency went through the roof but work
got done which meant that if it was transient load the system would feel
like treacle then perk up again where these days it seems the fashion of
most OS's to just explode messily.

In particular they did two things
- Actively tried to swap out all the bits of entire process victims to
  make space to do work under very high load
- When a process was pulled in it got time to run before it as opposed
  to someone else got dumped out

That has two good effects. Firstly the system could write out the process
data very efficiently and get it back likewise. Secondly the system ended
up in a kick one out, do work in the space we have to breath, stop, kick
next out, do work, and in most cases had little CPU contention so could
make good progress in each burst, albeit with the high latency cost.

Alan

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2011-08-19 21:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1312872786.70934.YahooMailNeo@web111712.mail.gq1.yahoo.com>
2011-08-09  7:06 ` Randy Dunlap
     [not found]   ` <1312874259.89770.YahooMailNeo@web111704.mail.gq1.yahoo.com>
2011-08-09 16:03     ` David Rientjes
2011-08-10  8:14       ` Mahmood Naderan
2011-08-11  4:09         ` David Rientjes
2011-08-11  7:07           ` Mahmood Naderan
2011-08-11  7:13             ` David Rientjes
2011-08-11  8:02               ` Mahmood Naderan
2011-08-11 12:47                 ` Denys Vlasenko
2011-08-11 15:13                   ` Mahmood Naderan
2011-08-11 17:38                     ` Denys Vlasenko
2011-08-17  8:50                       ` Mahmood Naderan
2011-08-18  2:18                       ` Pavel Ivanov
2011-08-18 12:44                         ` Denys Vlasenko
2011-08-18 14:26                           ` Pavel Ivanov
2011-08-18 22:25                             ` Denys Vlasenko
2011-08-19 19:21                               ` David Rientjes
2011-08-19 19:29                             ` Bryan Donlan
2011-08-19 21:19                               ` Chris Friesen
2011-08-19 21:38                                 ` Alan Cox [this message]

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=20110819223810.0f02016e@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=bdonlan@gmail.com \
    --cc=chris.friesen@genband.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nt_mahmood@yahoo.com \
    --cc=paivanof@gmail.com \
    --cc=rdunlap@xenotime.net \
    --cc=rientjes@google.com \
    --cc=vda.linux@googlemail.com \
    /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