linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@conectiva.com.br>
To: Jeremy Zawodny <Jeremy@Zawodny.com>
Cc: Phillip Susi <psusi@cfl.rr.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH]  Re: broken VM in 2.4.10-pre9
Date: Sun, 16 Sep 2001 16:54:28 -0300 (BRST)	[thread overview]
Message-ID: <Pine.LNX.4.33L.0109161652480.21279-100000@imladris.rielhome.conectiva> (raw)
In-Reply-To: <20010916123309.A15108@peach.zawodny.com>

On Sun, 16 Sep 2001, Jeremy Zawodny wrote:
> On Sun, Sep 16, 2001 at 03:19:29PM +0000, Phillip Susi wrote:
>
> > Maybe I'm missing something here, but it seems to me that these
> > problems are due to the cache putting pressure on VM, so process
> > pages get swapped out.
>
> That's what it felt like in the cases that I ran into it.  It was
> trying to treat all memory equally, when it probably shouldn't have.

Indeed, it should treat all memory equally, except when we
really have far too much cache.  I'll resend the patch with
the subject clearly marked since this trivial thing really
does need testers ;)

regards,

Rik
-- 
IA64: a worthy successor to i860.

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


--- mm/vmscan.c.orig	Sun Sep 16 16:44:14 2001
+++ mm/vmscan.c	Sun Sep 16 16:49:09 2001
@@ -731,6 +731,8 @@
  */
 #define too_many_buffers (atomic_read(&buffermem_pages) > \
 		(num_physpages * buffer_mem.borrow_percent / 100))
+#define too_much_cache (page_cache_size - swapper_space.nrpages) > \
+		(num_physpages * page_cache.borrow_percent / 100))
 int refill_inactive_scan(unsigned int priority)
 {
 	struct list_head * page_lru;
@@ -793,6 +795,18 @@
 		 * be reclaimed there...
 		 */
 		if (page->buffers && !page->mapping && too_many_buffers) {
+			deactivate_page_nolock(page);
+			page_active = 0;
+		}
+
+		/*
+		 * If the page cache is too large, move the page
+		 * to the inactive list. If it is really accessed
+		 * it'll be referenced before it reaches the point
+		 * where we'll reclaim it.
+		 */
+		if (page->mapping && too_much_cache && page_count(page) <=
+					(page->buffers ? 2 : 1)) {
 			deactivate_page_nolock(page);
 			page_active = 0;
 		}
--- mm/swap.c.orig	Sun Sep 16 16:50:43 2001
+++ mm/swap.c	Sun Sep 16 16:50:58 2001
@@ -64,7 +64,7 @@

 buffer_mem_t page_cache = {
 	2,	/* minimum percent page cache */
-	15,	/* borrow percent page cache */
+	60,	/* borrow percent page cache */
 	75	/* maximum */
 };



  reply	other threads:[~2001-09-16 19:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-15 22:43 broken VM in 2.4.10-pre9 Peter Magnusson
2001-09-15 23:50 ` Jan Harkes
2001-09-16  5:31 ` Linus Torvalds
2001-09-16  8:45   ` Eric W. Biederman
2001-09-17 10:25 ` Tonu Samuel
2001-09-16 16:47   ` Jeremy Zawodny
2001-09-16 18:36     ` Alan Cox
2001-09-16 19:38       ` Linus Torvalds
2001-09-16 18:34   ` vm rewrite ready [Re: broken VM in 2.4.10-pre9] Andrea Arcangeli
2001-09-16 19:07     ` Rik van Riel
2001-09-16 15:19       ` broken VM in 2.4.10-pre9 Phillip Susi
2001-09-16 19:33         ` Jeremy Zawodny
2001-09-16 19:54           ` Rik van Riel [this message]
2001-09-16 19:52         ` Rik van Riel
2001-09-16 19:17       ` vm rewrite ready [Re: broken VM in 2.4.10-pre9] Alan Cox
2001-09-16 19:15         ` Rik van Riel
2001-09-16 19:19       ` Andrea Arcangeli
2001-09-16 19:30         ` Linus Torvalds
     [not found]     ` <20010917174037.7e3739b9.skraw@ithnet.com>
     [not found]       ` <20010917181040.J713@athlon.random>
     [not found]         ` <20010917191256.6e6a1c87.skraw@ithnet.com>
2001-09-17 22:41           ` Andrea Arcangeli
2001-09-18  9:00       ` Stephan von Krawczynski
2001-09-16 19:37   ` broken VM in 2.4.10-pre9 Linus Torvalds
2001-09-17 14:04     ` Olaf Zaplinski

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.33L.0109161652480.21279-100000@imladris.rielhome.conectiva \
    --to=riel@conectiva.com.br \
    --cc=Jeremy@Zawodny.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=psusi@cfl.rr.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).