linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Con Kolivas <kernel@kolivas.org>
Cc: Chris Vine <chris@cvine.freeserve.co.uk>,
	Rik van Riel <riel@redhat.com>,
	linux-kernel@vger.kernel.org,
	"Martin J. Bligh" <mbligh@aracnet.com>
Subject: Re: 2.6.0-test9 - poor swap performance on low end machines
Date: Mon, 8 Dec 2003 05:52:25 -0800	[thread overview]
Message-ID: <20031208135225.GT19856@holomorphy.com> (raw)
In-Reply-To: <200311041355.08731.kernel@kolivas.org>

On Tue, Nov 04, 2003 at 01:55:08PM +1100, Con Kolivas wrote:
> This is now a balance tradeoff of trying to set a value that works for your 
> combination of the required ram of the applications you run concurrently, the 
> physical ram and the swap ram. As you can see from your example, in your 
> workload it seems there would be no point having more swap than your physical 
> ram since even if it tries to use say 40Mb it just drowns in a swapstorm. 
> Clearly this is not the case in a machine with more ram in different 
> circumstances, as swapping out say openoffice and mozilla while it's not 
> being used will not cause any harm to a kernel compile that takes up all the 
> available physical ram (it would actually be beneficial). Fortunately most 
> modern machines' ram vs application sizes are of the latter balance.
> There's always so much more you can do...
> wli, riel care to comment?

Explicit load control is in order. 2.4 appears to work better in these
instances because it victimizes one process at a time. It vaguely
resembles load control with a random demotion policy (mmlist order is
effectively random), but is the only method of page reclamation, which
disturbs its two-stage LRU, and basically livelocks in various situations
because having "demoted" a process address space to whatever extent it
does fails to eliminate it from consideration during further attempts
to reclaim memory to satisfy allocations.

On smaller machines or workloads with high levels of overcommitment
(in a sense different from non-overcommit; here it means that if all
tasks were executing simultaneously over some period of time they
would require more RAM than the machine has), the effect of load control
dominates replacement by several orders of magnitude, so the mere
presence of anything like a load control mechanism does them wonders.

According to a study from the 80's (Carr's thesis), the best load
control policies are demoting the smallest task, demoting the "most
recently activated task", and demoting the "task with the largest
remaining quantum". The latter two no longer make sense in the presence
of threads, or at least have to be revised not to assume a unique
execution context associated with a process address space. These three
Were said to be largely equivalent and performed 15% better than random.

Other important aspects of load control beyond the demotion policy are
explicit suspension the execution contexts of the process address
spaces chosen as its victims, complete eviction of the process address
space, load-time bonuses for process address spaces promoted from that
demoted status, and, of course, fair enough scheduling that starvation
or repetitive demotions of the same tasks (I think demoting the faulting
task runs into this) without forward progress don't occur.

2.4 does not do any of this.

The effect of not suspending the execution contexts of the demoted
process address spaces is that the victimized execution contexts thrash
while trying to reload the memory they need to execute. The effect of
incomplete demotion is essentially livelock under sufficient stress.
Its memory scheduling to what extent it has it is RR and hence fair,
but the various caveats above justify "does not do any of this",
particularly incomplete demotion.

So I predict that a true load control mechanism and policy would be
both an improvement over 2.4 and would correct 2.6 regressions vs. 2.4
on underprovisioned machines. For now, we lack an implementation.


-- wli

  parent reply	other threads:[~2003-12-08 13:52 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-29 22:30 2.6.0-test9 - poor swap performance on low end machines Chris Vine
2003-10-31  3:57 ` Rik van Riel
2003-10-31 11:26   ` Roger Luethi
2003-10-31 12:37     ` Con Kolivas
2003-10-31 12:59       ` Roger Luethi
2003-10-31 12:55     ` Ed Tomlinson
2003-11-01 18:34       ` Pasi Savolainen
2003-11-06 18:40       ` bill davidsen
2003-10-31 21:52   ` Chris Vine
2003-11-02 23:06   ` Chris Vine
2003-11-03  0:48     ` Con Kolivas
2003-11-03 21:13       ` Chris Vine
2003-11-04  2:55         ` Con Kolivas
2003-11-04 22:08           ` Chris Vine
2003-11-04 22:30             ` Con Kolivas
2003-12-08 13:52           ` William Lee Irwin III [this message]
2003-12-08 14:23             ` Con Kolivas
2003-12-08 14:30               ` William Lee Irwin III
2003-12-09 21:03               ` Chris Vine
2003-12-13 14:08               ` Chris Vine
2003-12-08 19:49             ` Roger Luethi
2003-12-08 20:48               ` William Lee Irwin III
2003-12-09  0:27                 ` Roger Luethi
2003-12-09  4:05                   ` William Lee Irwin III
2003-12-09 15:11                     ` Roger Luethi
2003-12-09 16:04                       ` Rik van Riel
2003-12-09 16:31                         ` Roger Luethi
2003-12-09 18:31                       ` William Lee Irwin III
2003-12-09 19:38                       ` William Lee Irwin III
2003-12-10 13:58                         ` Roger Luethi
2003-12-10 17:47                           ` William Lee Irwin III
2003-12-10 22:23                             ` Roger Luethi
2003-12-11  0:12                               ` William Lee Irwin III
2003-12-10 21:04                           ` Rik van Riel
2003-12-10 23:17                             ` Roger Luethi
2003-12-11  1:31                               ` Rik van Riel
2003-12-11 10:16                                 ` Roger Luethi
2003-12-10 23:30                           ` Helge Hafting
2003-12-10 21:52                 ` Andrea Arcangeli
2003-12-10 22:05                   ` Roger Luethi
2003-12-10 22:44                     ` Andrea Arcangeli
2003-12-11  1:28                       ` William Lee Irwin III
2003-12-11  1:32                         ` Rik van Riel
2003-12-11 10:16                       ` Roger Luethi
2003-12-15 23:31                       ` Andrew Morton
2003-12-15 23:37                         ` Andrea Arcangeli
2003-12-15 23:54                           ` Andrew Morton
2003-12-16  0:17                             ` Rik van Riel
2003-12-16 11:23                             ` Roger Luethi
2003-12-16 16:29                               ` Rik van Riel
2003-12-17 11:03                                 ` Roger Luethi
2003-12-17 11:06                                   ` William Lee Irwin III
2003-12-17 16:50                                     ` Roger Luethi
2003-12-17 11:33                                   ` Rik van Riel
2003-12-17 18:53                               ` Rik van Riel
2003-12-17 19:27                                 ` William Lee Irwin III
2003-12-17 19:51                                   ` Rik van Riel
2003-12-17 19:49                                 ` Roger Luethi
2003-12-17 21:41                                   ` Andrew Morton
2003-12-17 21:41                                   ` Roger Luethi
2003-12-18  0:21                                     ` Rik van Riel
2003-12-18 22:53                                       ` Roger Luethi
2003-12-18 23:38                                         ` William Lee Irwin III

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=20031208135225.GT19856@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=chris@cvine.freeserve.co.uk \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    --cc=riel@redhat.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;
as well as URLs for NNTP newsgroup(s).