linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ray Bryant <raybry@sgi.com>
To: piggin@cyberone.com.au
Cc: William Lee Irwin III <wli@holomorphy.com>,
	Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
	Con Kolivas <kernel@kolivas.org>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	riel@redhat.com
Subject: Re: swapping and the value of /proc/sys/vm/swappiness
Date: Mon, 27 Sep 2004 20:54:35 -0500	[thread overview]
Message-ID: <4158C45B.8090409@sgi.com> (raw)
In-Reply-To: <20040909030916.GR3106@holomorphy.com>

[-- Attachment #1: Type: text/plain, Size: 2187 bytes --]

Nick,

As reported to you elsewhere (and duplicated here to get on this thread),
application of the patch you sent (attached) dramatically changes the
swappiness behavior of the 2.6.9-rc1 (and presumably the rc2) kernel.

Here are the updated results:

Previously:

Kernel Version 2.6.9-rc1-mm3:
         Total I/O   Avg Swap   min    max     pg cache    min    max
        ----------- --------- ------- ------  --------- ------- -------
    0   274.80 MB/s  10511 MB (  5644, 14492)  13293 MB (  8596, 17156)
   20   267.02 MB/s  12624 MB (  5578, 16287)  15298 MB (  8468, 18889)
   40   267.66 MB/s  13541 MB (  6619, 17461)  16199 MB (  9393, 20044)
   60   233.73 MB/s  18094 MB ( 16550, 19676)  20629 MB ( 19103, 22192)
   80   213.64 MB/s  20950 MB ( 15844, 22977)  23450 MB ( 18496, 25440)
  100   164.58 MB/s  26004 MB ( 26004, 26004)  28410 MB ( 28327, 28455)

With Nick Piggin et al fix:

Kernel Version: linux-2.6.9-rc1-mm3-kswapdfix

         Total I/O   Avg Swap   min    max     pg cache    min    max
        ----------- --------- ------- ------  --------- ------- -------
    0   279.97 MB/s     89 MB (    12,   265)   3062 MB (  2947,  3267)
   20   283.55 MB/s    161 MB (    15,   372)   3190 MB (  3011,  3427)
   40   282.32 MB/s    204 MB (     6,   407)   3187 MB (  2995,  3331)
   60   279.42 MB/s     72 MB (    15,   171)   3091 MB (  3027,  3155)
   80   283.34 MB/s    920 MB (   144,  3028)   3904 MB (  3106,  5957)
  100   160.55 MB/s  26008 MB ( 26007, 26008)  28473 MB ( 28455, 28487)

(The drop at swappiness of 60 may just be randomness, not sure it
is significant, but these results are all based on 5 trials.)

At any rate, this patch appears to fix the problems I was seeing before.
(See
	http://marc.theaimsgroup.com/?l=linux-kernel&m=109449778320333&w=2

for further details of the benchmark and the test environment).
-- 
Best Regards,
Ray
-----------------------------------------------
                   Ray Bryant
512-453-9679 (work)         512-507-7807 (cell)
raybry@sgi.com             raybry@austin.rr.com
The box said: "Requires Windows 98 or better",
            so I installed Linux.
-----------------------------------------------

[-- Attachment #2: vm-no-wild-kswapd.patch --]
[-- Type: text/plain, Size: 1231 bytes --]




---

 linux-2.6-npiggin/mm/vmscan.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletion(-)

diff -puN mm/vmscan.c~vm-no-wild-kswapd mm/vmscan.c
--- linux-2.6/mm/vmscan.c~vm-no-wild-kswapd	2004-09-25 10:09:16.000000000 +1000
+++ linux-2.6-npiggin/mm/vmscan.c	2004-09-25 10:15:58.000000000 +1000
@@ -993,10 +993,13 @@ static int balance_pgdat(pg_data_t *pgda
 	int to_free = nr_pages;
 	int priority;
 	int i;
-	int total_scanned = 0, total_reclaimed = 0;
+	int total_scanned, total_reclaimed;
 	struct reclaim_state *reclaim_state = current->reclaim_state;
 	struct scan_control sc;
 
+loop_again:
+	total_scanned = 0;
+	total_reclaimed = 0;
 	sc.gfp_mask = GFP_KERNEL;
 	sc.may_writepage = 0;
 	sc.nr_mapped = read_page_state(nr_mapped);
@@ -1095,6 +1098,15 @@ scan:
 		 */
 		if (total_scanned && priority < DEF_PRIORITY - 2)
 			blk_congestion_wait(WRITE, HZ/10);
+
+		/*
+		 * We do this so kswapd doesn't build up large priorities for
+		 * example when it is freeing in parallel with allocators. It
+		 * matches the direct reclaim path behaviour in terms of impact
+		 * on zone->*_priority.
+		 */
+		if (total_reclaimed >= 32)
+			goto loop_again;
 	}
 out:
 	for (i = 0; i < pgdat->nr_zones; i++) {

_

  parent reply	other threads:[~2004-09-28  1:54 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-06 19:11 Ray Bryant
2004-09-06 20:10 ` Andrew Morton
2004-09-06 21:22   ` Ray Bryant
2004-09-06 21:36     ` Andrew Morton
2004-09-06 22:37     ` William Lee Irwin III
2004-09-06 23:51       ` Nick Piggin
2004-09-07  0:31         ` Ray Bryant
2004-09-06 22:48 ` William Lee Irwin III
2004-09-06 23:09 ` Con Kolivas
2004-09-06 23:27   ` Andrew Morton
2004-09-06 23:34     ` Con Kolivas
2004-09-07  0:03       ` Marcelo Tosatti
2004-09-07  1:34         ` Con Kolivas
2004-09-07 10:38         ` Nick Piggin
2004-09-07 10:56           ` Con Kolivas
2004-09-08 16:45             ` Marcelo Tosatti
2004-09-09  1:12               ` Con Kolivas
2004-09-07 17:03           ` Ray Bryant
2004-09-07 21:20         ` Marcelo Tosatti
2004-09-08  2:18           ` Marcelo Tosatti
2004-09-08 14:20           ` Ray Bryant
2004-09-08 16:54             ` Marcelo Tosatti
2004-09-08 19:35               ` Ray Bryant
2004-09-08 19:30                 ` Marcelo Tosatti
2004-09-09  3:06                   ` Ray Bryant
2004-09-09  2:14                     ` Marcelo Tosatti
2004-09-09 14:21                       ` Ray Bryant
2004-09-09  3:09                     ` William Lee Irwin III
2004-09-09 14:16                       ` Ray Bryant
2004-09-09 17:23                         ` William Lee Irwin III
2004-09-28  1:54                       ` Ray Bryant [this message]
2004-09-28  3:36                         ` Nick Piggin
2004-09-29  0:36                           ` Nick Piggin
2004-09-29  4:23                             ` Ray Bryant
2004-09-30 17:15                             ` Ray Bryant
2004-09-08 17:31             ` Martin J. Bligh
2004-09-08 18:04               ` Rik van Riel
2004-09-08 19:50                 ` Diego Calleja
2004-09-08 21:10                   ` Martin J. Bligh
2004-09-08 21:55                     ` Diego Calleja
2004-09-08 22:20                       ` Martin J. Bligh
2004-09-08 23:22                         ` Rik van Riel
2004-09-08 22:28                     ` Alan Cox
2004-09-08 23:42                       ` Martin J. Bligh
2004-09-08 19:54               ` Ray Bryant
2004-09-08 15:19           ` Ray Bryant

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=4158C45B.8090409@sgi.com \
    --to=raybry@sgi.com \
    --cc=akpm@osdl.org \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=piggin@cyberone.com.au \
    --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