linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo@conectiva.com.br>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: "André Dahlqvist" <anedah-9@sm.luth.se>, linux-mm@kvack.org
Subject: [PATCH] reapswap for 2.4.5-ac10
Date: Tue, 5 Jun 2001 16:48:46 -0300 (BRT)	[thread overview]
Message-ID: <Pine.LNX.4.21.0106051646570.2997-100000@freak.distro.conectiva> (raw)

Hi Alan, 

I'm resending the reapswap patch for inclusion into -ac series. 

--- linux.orig/mm/vmscan.c	Wed May 30 14:51:21 2001
+++ linux/mm/vmscan.c	Wed May 30 16:18:41 2001
@@ -461,6 +461,28 @@
 			continue;
 		}
 
+		/*
+		 * FIXME: this is a hack.
+		 *
+		 * Check for dead swap cache pages and clean
+		 * them as fast as possible, before doing any other checks.
+		 *
+		 * Note: We are guaranteeing that this page will never 
+		 * be touched in the future because a dirty page with no
+		 * other users than the swapcache will never be referenced
+		 * again.
+		 * 
+		 */
+
+		if (PageSwapCache(page) && PageDirty(page) &&
+				(page_count(page) - !!page->buffers) == 1 &&
+				swap_count(page) == 1) { 
+			ClearPageDirty(page);
+			ClearPageReferenced(page);
+			page->age = 0;
+		}
+
+			
 		/* Page is or was in use?  Move it to the active list. */
 		if (PageReferenced(page) || page->age > 0 ||
 				(!page->buffers && page_count(page) > 1) ||
@@ -686,6 +708,21 @@
 			nr_active_pages--;
 			continue;
 		}
+		
+		/*
+		 * FIXME: hack
+		 *
+		 * Special case for dead swap cache pages.
+		 * See comment on page_launder() for more info.
+		 */
+		if (PageSwapCache(page) && PageDirty(page) &&
+				(page_count(page) - !!page->buffers) == 1 &&
+				swap_count(page) == 1) {
+			deactivate_page_nolock(page);
+			nr_deactivated++;
+			continue;
+		}
+
 
 		/* Do aging on the pages. */
 		if (PageTestandClearReferenced(page)) {


--
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/

             reply	other threads:[~2001-06-05 19:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-05 19:48 Marcelo Tosatti [this message]
2001-06-05 22:14 ` Stephen C. Tweedie
2001-06-05 20:46   ` Marcelo Tosatti
2001-06-06 12:31     ` Hugh Dickins
2001-06-06 19:17       ` Marcelo Tosatti
2001-06-06  8:39 Jonathan Morton
2001-06-06 12:21 ` Andrew Morton
2001-06-06 12:47   ` Stephen C. Tweedie
2001-06-06 12:50   ` Jonathan Morton
2001-06-06 13:12     ` Andrew Morton
2001-06-06 16:44       ` Jonathan Morton
2001-06-06 17:01         ` Andrew Morton
2001-06-06 19:40           ` Jonathan Morton
2001-06-09  7:46         ` Rik van Riel
2001-06-06 19:18 ` Marcelo Tosatti
2001-06-06 21:13   ` Jonathan Morton
2001-06-07 14:45     ` John Stoffel
2001-06-07 16:45       ` Jonathan Morton
2001-06-11  4:43 ` Joseph A. Knapka

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.0106051646570.2997-100000@freak.distro.conectiva \
    --to=marcelo@conectiva.com.br \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=anedah-9@sm.luth.se \
    --cc=linux-mm@kvack.org \
    /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