linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Luethi <rl@hellgate.ch>
To: William Lee Irwin III <wli@holomorphy.com>,
	Rik van Riel <riel@redhat.com>, Andrew Morton <akpm@osdl.org>,
	Andrea Arcangeli <andrea@suse.de>,
	kernel@kolivas.org, chris@cvine.freeserve.co.uk,
	linux-kernel@vger.kernel.org, mbligh@aracnet.com
Subject: Re: 2.6.0-test9 - poor swap performance on low end machines
Date: Wed, 17 Dec 2003 17:50:26 +0100	[thread overview]
Message-ID: <20031217165025.GA15691@k3.hellgate.ch> (raw)
In-Reply-To: <20031217110648.GB31393@holomorphy.com>

On Wed, 17 Dec 2003 03:06:48 -0800, William Lee Irwin III wrote:
> to lkml. Hearing more about the various degradations you've identified
> would be helpful.

I'll use 2.6.0-test3 again as the example. That release brought a
slight improvement for qsbench and big slowdowns for kbuild and efax
(check the numbers I posted for details), due to two patches: "fix
kswapd throttling" (patch 1) and "decaying average of zone pressure/use
zone_pressure for page unmapping" (patch 2).

Even as late as test9 I found that reverting patches 1 and 2 changed
performance numbers for all benchmarks pretty much back to test2 level.
Reverting only patch 1 brought a partial improvement, reverting only
patch 2 none at all.

Patch 1 prevented those frequent calls to blk_congestion_wait in
balance_pgdat when enough pages were freed:

diff -Nru a/mm/vmscan.c b/mm/vmscan.c
--- a/mm/vmscan.c	Thu Jul 17 06:09:38 2003
+++ b/mm/vmscan.c	Fri Aug  1 03:02:09 2003
@@ -930,7 +930,8 @@
 		}
 		if (all_zones_ok)
 			break;
-		blk_congestion_wait(WRITE, HZ/10);
+		if (to_free > 0)
+			blk_congestion_wait(WRITE, HZ/10);
 	}
 	return nr_pages - to_free;
 }

Unconditional blk_congestion_wait breaks (as they have been in test2 and
earlier) reduce the speed at which kswapd can free pages, making it much
more likely that memory is reclaimed by the allocator (try_to_free_pages)
because kswapd fails to keep up with demand.

Patch 2 changed distress and thus reclaim_mapped in refill_inactive_zone.
distress became less volatile -- kernels before test3 tended to consider
mapped pages only after a few iterations in balance_pgdat (i.e. with
raising priority).

To get the benefits of reverting patch 2 in test3/test9 this small
patch should suffice:

diff -u ./mm/vmscan.c ./mm/vmscan.c
--- ./mm/vmscan.c	Wed Nov 19 11:02:51 2003
+++ ./mm/vmscan.c	Wed Nov 19 23:53:06 2003
@@ -632,7 +632,7 @@
 	 * `distress' is a measure of how much trouble we're having reclaiming
 	 * pages.  0 -> no problems.  100 -> great trouble.
 	 */
-	distress = 100 >> zone->prev_priority;
+	distress = 100 >> priority;
 
 	/*
 	 * The point of this algorithm is to decide when to start reclaiming

Without patch 2 (kernel test2 and earlier), kswapd freeing is frequently
interrupted by the allocator satisfying immediate needs. With the
patch, refill is dominated by long, undisturbed sequences driven by
kswapd.

All this has little impact on qsbench because unlike the other two
benchmarks qsbench hardly ever fails to convince refill_inactive_zone to
consider mapped pages as well (thanks to an extremely high mapped_ratio).

Roger

  reply	other threads:[~2003-12-17 16:51 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
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 [this message]
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=20031217165025.GA15691@k3.hellgate.ch \
    --to=rl@hellgate.ch \
    --cc=akpm@osdl.org \
    --cc=andrea@suse.de \
    --cc=chris@cvine.freeserve.co.uk \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    --cc=riel@redhat.com \
    --cc=wli@holomorphy.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).