All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] filemap.c fixes
@ 2001-05-14  4:00 Rik van Riel
  2001-05-14 13:54 ` Daniel Phillips
  0 siblings, 1 reply; 7+ messages in thread
From: Rik van Riel @ 2001-05-14  4:00 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

Hi Linus,

here are a filemap.c fix and a slight addition:

1) __find_page_nolock should only set the referenced bit
   on an active page, otherwise a number of subsequent
   reads from the same page within one page scan interval
   can SEVERELY mess up page aging to the disadvantage of
   the other pages in the system ...
   just setting the referenced bit on the page makes the
   aging a lot fairer

2) in drop_behind() we first increase the page age and
   will then proceed to deactivate the page again; better
   have a simpler help function for this ... note that this
   help function could also be used for eg. ->writepage()
   write clustering code

regards,

Rik
--
Virtual memory is like a game you can't win;
However, without VM there's truly nothing to lose...

http://www.surriel.com/		http://distro.conectiva.com/

Send all your spam to aardvark@nl.linux.org (spam digging piggy)



--- linux-2.4.5-pre1/mm/filemap.c.orig	Mon May 14 00:55:53 2001
+++ linux-2.4.5-pre1/mm/filemap.c	Mon May 14 00:56:03 2001
@@ -299,13 +299,14 @@
 			break;
 	}
 	/*
-	 * Touching the page may move it to the active list.
-	 * If we end up with too few inactive pages, we wake
-	 * up kswapd.
+	 * Mark the page referenced, moving inactive pages to the
+	 * active list.
 	 */
-	age_page_up(page);
-	if (inactive_shortage() > inactive_target / 2 && free_shortage())
-			wakeup_kswapd();
+	if (!PageActive(page))
+		activate_page(page);
+	else
+		SetPageReferenced(page);
+
 not_found:
 	return page;
 }
@@ -783,8 +784,7 @@
 	 */
 	spin_lock(&pagecache_lock);
 	while (--index >= start) {
-		hash = page_hash(mapping, index);
-		page = __find_page_nolock(mapping, index, *hash);
+		page = __find_page_simple(mapping, index);
 		if (!page)
 			break;
 		deactivate_page(page);


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-05-15 15:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-14  4:00 [PATCH] filemap.c fixes Rik van Riel
2001-05-14 13:54 ` Daniel Phillips
2001-05-14 14:11   ` Rik van Riel
2001-05-15  6:48     ` Linus Torvalds
2001-05-15 15:12       ` Rik van Riel
2001-05-15 15:37         ` Linus Torvalds
2001-05-15 15:49           ` Rik van Riel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.