linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ben LaHaise <bcrl@redhat.com>
To: linux-mm@kvack.org
Cc: torvalds@transmeta.com
Subject: [rtf] [patch] 2.3.99-pre6-3 overly swappy
Date: Thu, 20 Apr 2000 15:43:23 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.21.0004201538200.8445-100000@devserv.devel.redhat.com> (raw)

The balance between swap and shrink_mmap was upset by the recent per-zone
changes: kswapd wakeups now call swap_out 3 times as much as before,
resulting in increased page faults and swap out activity, especially
under heavy io.  This patch seems to help quite a bit -- can other people
give this a try?

		-ben

diff -ur 2.3.99-pre6-3/mm/vmscan.c linux-test/mm/vmscan.c
--- 2.3.99-pre6-3/mm/vmscan.c	Wed Apr 12 14:39:50 2000
+++ linux-test/mm/vmscan.c	Thu Apr 20 15:12:17 2000
@@ -408,7 +408,7 @@
  * cluster them so that we get good swap-out behaviour. See
  * the "free_memory()" macro for details.
  */
-static int do_try_to_free_pages(unsigned int gfp_mask, zone_t *zone)
+static int do_try_to_free_pages(unsigned int gfp_mask, zone_t *zone, int do_swap)
 {
 	int priority;
 	int count = SWAP_CLUSTER_MAX;
@@ -423,6 +423,8 @@
 				goto done;
 		}
 
+		if (!do_swap)
+			continue;
 
 		/* Try to get rid of some shared memory pages.. */
 		if (gfp_mask & __GFP_IO) {
@@ -507,7 +509,7 @@
 					schedule();
 				if ((!zone->size) || (!zone->zone_wake_kswapd))
 					continue;
-				do_try_to_free_pages(GFP_KSWAPD, zone);
+				do_try_to_free_pages(GFP_KSWAPD, zone, i == (MAX_NR_ZONES - 1));
 			}
 			pgdat = pgdat->node_next;
 		}
@@ -538,7 +540,7 @@
 
 	if (gfp_mask & __GFP_WAIT) {
 		current->flags |= PF_MEMALLOC;
-		retval = do_try_to_free_pages(gfp_mask, zone);
+		retval = do_try_to_free_pages(gfp_mask, zone, 1);
 		current->flags &= ~PF_MEMALLOC;
 	}
 	return retval;

--
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.eu.org/Linux-MM/

             reply	other threads:[~2000-04-20 19:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-20 19:43 Ben LaHaise [this message]
2000-04-20 20:13 ` Rik van Riel
2000-04-21  0:25 ` Juan J. Quintela
2000-04-21  2:54   ` Ben LaHaise
2000-04-21 17:50     ` Juan J. Quintela
2000-04-22 18:14       ` Juan J. Quintela

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=Pine.LNX.4.21.0004201538200.8445-100000@devserv.devel.redhat.com \
    --to=bcrl@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@transmeta.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