From: Rik van Riel <riel@conectiva.com.br>
To: Phillip Susi <psusi@cfl.rr.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: broken VM in 2.4.10-pre9
Date: Sun, 16 Sep 2001 16:52:02 -0300 (BRST) [thread overview]
Message-ID: <Pine.LNX.4.33L.0109161636310.21279-100000@imladris.rielhome.conectiva> (raw)
In-Reply-To: <200109161919.f8GJJwA25036@smtp-server3.tampabay.rr.com>
On Sun, 16 Sep 2001, 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. The obvious solution to this is to limit the size of
> the cache, or implement some sort of algorithm to slow its growth and
> reduce the pressure on VM.
> Am I way off base here?
You're absolutely right and it's only a tiny patch to
implement this thing. I've attached a completely
untested (I haven't even compiled this thing) patch
which implements this thing. I suspect it'll apply to
any recent -ac kernel, porting it to -linus should be
easy.
regards,
Rik
--
IA64: a worthy successor to i860.
http://www.surriel.com/ http://distro.conectiva.com/
Send all your spam to aardvark@nl.linux.org (spam digging piggy)
--- 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 */
};
next prev parent reply other threads:[~2001-09-16 19:52 UTC|newest]
Thread overview: 125+ 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 ` [PATCH] " Rik van Riel
2001-09-16 19:52 ` Rik van Riel [this message]
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
2001-09-16 15:19 Ricardo Galli
2001-09-16 15:23 ` Michael Rothwell
2001-09-16 16:33 ` Rik van Riel
2001-09-16 16:50 ` Andreas Steinmetz
2001-09-16 17:12 ` Ricardo Galli
2001-09-16 17:06 ` Ricardo Galli
2001-09-16 17:18 ` Jeremy Zawodny
2001-09-16 18:45 ` Stephan von Krawczynski
2001-09-21 3:16 ` Bill Davidsen
2001-09-21 10:21 ` Stephan von Krawczynski
2001-09-21 14:08 ` Bill Davidsen
2001-09-21 14:23 ` Rik van Riel
2001-09-23 13:13 ` Eric W. Biederman
2001-09-23 13:27 ` Rik van Riel
2001-09-21 10:43 ` Stephan von Krawczynski
2001-09-21 12:13 ` Rik van Riel
2001-09-21 12:55 ` Stephan von Krawczynski
2001-09-21 13:01 ` Rik van Riel
2001-09-22 11:01 ` Daniel Phillips
2001-09-22 20:05 ` Rik van Riel
2001-09-16 18:16 ` Stephan von Krawczynski
2001-09-16 19:43 ` Linus Torvalds
2001-09-16 19:57 ` Rik van Riel
2001-09-16 20:17 ` Rik van Riel
2001-09-16 20:29 ` Andreas Steinmetz
2001-09-16 21:28 ` Linus Torvalds
2001-09-16 22:47 ` Alex Bligh - linux-kernel
2001-09-16 22:55 ` Linus Torvalds
2001-09-16 22:59 ` Stephan von Krawczynski
2001-09-16 22:14 ` Linus Torvalds
2001-09-16 23:29 ` Stephan von Krawczynski
2001-09-17 15:35 ` Stephan von Krawczynski
2001-09-17 15:51 ` Linus Torvalds
2001-09-17 16:34 ` Stephan von Krawczynski
2001-09-17 16:46 ` Linus Torvalds
2001-09-17 17:20 ` Stephan von Krawczynski
2001-09-17 17:37 ` Linus Torvalds
2001-09-17 0:37 ` Daniel Phillips
2001-09-17 1:07 ` Linus Torvalds
2001-09-17 2:23 ` Daniel Phillips
2001-09-17 5:11 ` Jan Harkes
2001-09-17 12:33 ` Daniel Phillips
2001-09-17 12:41 ` Rik van Riel
2001-09-17 14:49 ` Daniel Phillips
2001-09-17 16:14 ` Jan Harkes
2001-09-17 16:34 ` Linus Torvalds
2001-09-17 15:38 ` Linus Torvalds
2001-09-17 12:26 ` Rik van Riel
2001-09-17 15:42 ` Linus Torvalds
2001-09-18 12:04 ` Rik van Riel
2001-09-17 17:33 ` Linus Torvalds
2001-09-17 18:07 ` Linus Torvalds
2001-09-18 12:09 ` Rik van Riel
2001-09-21 3:10 ` Bill Davidsen
2001-09-17 8:06 ` Eric W. Biederman
2001-09-17 12:12 ` Rik van Riel
2001-09-17 15:45 ` Eric W. Biederman
[not found] <fa.i95if5v.74un2p@ifi.uio.no>
[not found] ` <fa.gu977tv.1b7u0g9@ifi.uio.no>
2001-09-16 18:06 ` Dan Maas
2001-09-17 15:40 Rob Fuller
2001-09-17 16:03 ` Eric W. Biederman
2001-09-19 9:45 ` Daniel Phillips
2001-09-19 19:45 ` Alan Cox
2001-09-19 21:03 ` Eric W. Biederman
2001-09-19 22:04 ` Alan Cox
2001-09-19 22:26 ` Eric W. Biederman
2001-09-19 23:05 ` Rik van Riel
2001-09-20 11:28 ` Daniel Phillips
2001-09-20 12:06 ` Rik van Riel
2001-09-21 8:13 ` Daniel Phillips
2001-09-21 12:10 ` Rik van Riel
2001-09-21 15:27 ` Jan Harkes
2001-09-22 7:09 ` Daniel Phillips
2001-09-25 11:04 ` Mike Fedyk
2001-09-20 12:57 ` Alan Cox
2001-09-20 13:40 ` Daniel Phillips
2001-09-24 22:50 ` Pavel Machek
2001-09-26 18:22 ` Marcelo Tosatti
2001-09-26 23:44 ` Pavel Machek
2001-09-27 13:52 ` Eric W. Biederman
2001-10-01 11:37 ` Marcelo Tosatti
2001-09-19 23:00 ` Rik van Riel
2001-09-21 8:23 ` Eric W. Biederman
2001-09-21 12:01 ` Rik van Riel
2001-09-22 2:14 ` Alexander Viro
2001-09-22 3:09 ` Rik van Riel
2001-09-21 14:29 ` Gábor Lénárt
2001-09-21 14:35 ` Horst von Brand
2001-09-19 21:37 ` Eric W. Biederman
2001-09-19 21:55 ` David S. Miller
2001-09-20 13:02 ` Rik van Riel
2001-09-19 22:15 Rob Fuller
2001-09-19 22:21 ` David S. Miller
2001-09-19 22:26 ` Christoph Hellwig
2001-09-19 22:30 ` Alan Cox
2001-09-19 22:48 ` Eric W. Biederman
2001-09-19 22:51 ` Bryan O'Sullivan
2001-09-20 3:16 ` GOTO Masanori
2001-09-20 7:38 ` Christoph Hellwig
2001-09-22 19:59 Peter Magnusson
2001-09-22 20:18 ` Rik van Riel
2001-09-22 19:59 Peter Magnusson
2001-09-22 20:46 ` Jan Harkes
2001-09-22 21:46 ` Peter Magnusson
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.0109161636310.21279-100000@imladris.rielhome.conectiva \
--to=riel@conectiva.com.br \
--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).