From: Rik van Riel <H.H.vanRiel@phys.uu.nl>
To: Linux MM <linux-mm@kvack.org>
Cc: Andrea Arcangeli <arcangeli@mbox.queen.it>
Subject: [PATCH] stricter pagecache pruning
Date: Sat, 11 Jul 1998 09:31:26 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.3.96.980711092706.5292B-200000@mirkwood.dummy.home> (raw)
[-- Attachment #1: Type: TEXT/PLAIN, Size: 720 bytes --]
Hi,
I hope this patch will alleviate some of Andrea's
problems with the page cache growing out of bounds.
It makes sure that, when the cache uses too much,
shrink_mmap() is called continuously; only the
last thing tried can be something else.
I'd like to hear some results, as I haven't tried
it myself ... It seems obvious enough, so it would
probably be best if it's tried ASAP with as many
different machines/loads as possible.
Rik.
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+
[-- Attachment #2: mmap-prune-2.1.108.patch --]
[-- Type: TEXT/PLAIN, Size: 938 bytes --]
--- linux/mm/vmscan.c.orig Sat Jul 11 09:13:37 1998
+++ linux/mm/vmscan.c Sat Jul 11 09:26:18 1998
@@ -448,7 +448,7 @@
{
static int state = 0;
int i=6;
- int stop;
+ int stop, shrink = 0;
/* Always trim SLAB caches when memory gets low. */
kmem_cache_reap(gfp_mask);
@@ -458,14 +458,19 @@
if (gfp_mask & __GFP_WAIT)
stop = 0;
if (((buffermem >> PAGE_SHIFT) * 100 > buffer_mem.borrow_percent * num_physpages)
- || (page_cache_size * 100 > page_cache.borrow_percent * num_physpages))
+ || (page_cache_size * 100 > page_cache.borrow_percent * num_physpages)) {
state = 0;
+ shrink = i - stop;
+ }
switch (state) {
do {
case 0:
- if (shrink_mmap(i, gfp_mask))
- return 1;
+ do {
+ if (shrink_mmap(i, gfp_mask))
+ return 1;
+ if (shrink) shrink--;
+ } while (shrink);
state = 1;
case 1:
if ((gfp_mask & __GFP_IO) && shm_swap(i, gfp_mask))
next reply other threads:[~1998-07-11 7:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-07-11 7:31 Rik van Riel [this message]
1998-07-11 15:11 ` Andrea Arcangeli
1998-07-15 16:56 ` Dr. Werner Fink
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.3.96.980711092706.5292B-200000@mirkwood.dummy.home \
--to=h.h.vanriel@phys.uu.nl \
--cc=arcangeli@mbox.queen.it \
--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