From: "Dr. Werner Fink" <werner@suse.de>
To: linux-mm@kvack.org
Subject: Re: More info: 2.1.108 page cache performance on low memory
Date: Thu, 23 Jul 1998 21:12:22 +0200 [thread overview]
Message-ID: <19980723211222.37937@boole.suse.de> (raw)
In-Reply-To: <87hg08vnmt.fsf@atlas.CARNet.hr>; from Zlatko Calusic on Thu, Jul 23, 1998 at 12:59:38PM +0200
On Thu, Jul 23, 1998 at 12:59:38PM +0200, Zlatko Calusic wrote:
>
> I tried the other way, to age page cache harder, and it looks like it
> works very well. Patch is simple, so simple that I can't understand
> nobody suggested (something like) it yet.
>
>
> --- filemap.c.virgin Tue Jul 21 18:41:30 1998
> +++ filemap.c Thu Jul 23 12:14:43 1998
> @@ -171,6 +171,11 @@
> touch_page(page);
> break;
> }
> + /* Age named pages aggresively, so page cache
> + * doesn't grow too fast. -zcalusic
> + */
> + age_page(page);
> + age_page(page);
> age_page(page);
> if (page->age)
> break;
>
I've something similar ... cut&paste (no tabs) ... which would only do
less graduated ageing on small systems.
-------------------------------------------------------------------------------
diff -urN linux-2.1.110/include/linux/swapctl.h linux/include/linux/swapctl.h
--- linux-2.1.110/include/linux/swapctl.h Tue Jul 21 02:32:01 1998
+++ linux/include/linux/swapctl.h Wed Jul 22 18:04:28 1998
@@ -94,12 +94,26 @@
return n;
}
+extern int pgcache_max_age;
+extern void do_pgcache_max_age(void);
+
static inline void touch_page(struct page *page)
{
- if (page->age < (MAX_PAGE_AGE - PAGE_ADVANCE))
+ int max_age = MAX_PAGE_AGE;
+
+ if (atomic_read(&page->count) == 1) {
+ static int save_max_age = 0;
+ if (save_max_age != max_age) {
+ save_max_age = max_age;
+ do_pgcache_max_age();
+ }
+ max_age = pgcache_max_age;
+ }
+
+ if (page->age < (max_age - PAGE_ADVANCE))
page->age += PAGE_ADVANCE;
else
- page->age = MAX_PAGE_AGE;
+ page->age = max_age;
}
static inline void age_page(struct page *page)
diff -urN linux-2.1.110/include/linux/swapctl.h linux/include/linux/swapctl.h
--- linux-2.1.110/include/linux/swapctl.h Tue Jul 21 02:32:01 1998
+++ linux/include/linux/swapctl.h Wed Jul 22 18:04:28 1998
@@ -94,12 +94,26 @@
return n;
}
+extern int pgcache_max_age;
+extern void do_pgcache_max_age(void);
+
static inline void touch_page(struct page *page)
{
- if (page->age < (MAX_PAGE_AGE - PAGE_ADVANCE))
+ int max_age = MAX_PAGE_AGE;
+
+ if (atomic_read(&page->count) == 1) {
+ static int save_max_age = 0;
+ if (save_max_age != max_age) {
+ save_max_age = max_age;
+ do_pgcache_max_age();
+ }
+ max_age = pgcache_max_age;
+ }
+
+ if (page->age < (max_age - PAGE_ADVANCE))
page->age += PAGE_ADVANCE;
else
- page->age = MAX_PAGE_AGE;
+ page->age = max_age;
}
static inline void age_page(struct page *page)
-------------------------------------------------------------------------------
Werner
--
This is a majordomo managed list. To unsubscribe, send a message with
the body 'unsubscribe linux-mm me@address' to: majordomo@kvack.org
next prev parent reply other threads:[~1998-07-23 19:16 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-07-13 16:53 Stephen C. Tweedie
1998-07-13 18:08 ` Eric W. Biederman
1998-07-13 18:29 ` Zlatko Calusic
1998-07-14 17:32 ` Stephen C. Tweedie
1998-07-16 12:31 ` Zlatko Calusic
1998-07-14 17:30 ` Stephen C. Tweedie
1998-07-18 1:10 ` Eric W. Biederman
1998-07-18 13:28 ` Zlatko Calusic
1998-07-18 16:40 ` Eric W. Biederman
1998-07-20 9:15 ` Zlatko Calusic
1998-07-22 10:40 ` Stephen C. Tweedie
1998-07-23 10:06 ` Zlatko Calusic
1998-07-23 12:22 ` Stephen C. Tweedie
1998-07-23 14:07 ` Zlatko Calusic
1998-07-23 17:18 ` Stephen C. Tweedie
1998-07-23 19:33 ` Zlatko Calusic
1998-07-27 10:57 ` Stephen C. Tweedie
1998-07-26 14:49 ` Eric W Biederman
1998-07-27 11:02 ` Stephen C. Tweedie
1998-08-02 5:19 ` Eric W Biederman
1998-08-17 13:57 ` Stephen C. Tweedie
1998-08-17 15:35 ` Stephen C. Tweedie
1998-08-20 12:40 ` Eric W. Biederman
1998-07-20 15:58 ` Stephen C. Tweedie
1998-07-22 10:36 ` Stephen C. Tweedie
1998-07-22 18:01 ` Rik van Riel
1998-07-23 10:59 ` Stephen C. Tweedie
1998-07-22 10:33 ` Stephen C. Tweedie
1998-07-23 10:59 ` Zlatko Calusic
1998-07-23 12:23 ` Stephen C. Tweedie
1998-07-23 15:06 ` Zlatko Calusic
1998-07-23 15:17 ` Benjamin C.R. LaHaise
1998-07-23 15:25 ` Zlatko Calusic
1998-07-23 17:27 ` Benjamin C.R. LaHaise
1998-07-23 19:17 ` Dr. Werner Fink
1998-07-23 17:12 ` Stephen C. Tweedie
1998-07-23 17:42 ` Zlatko Calusic
1998-07-23 19:12 ` Dr. Werner Fink [this message]
1998-07-27 10:40 ` Stephen C. Tweedie
1998-07-23 19:51 ` Rik van Riel
1998-07-24 11:21 ` Zlatko Calusic
1998-07-24 14:25 ` Rik van Riel
1998-07-24 17:01 ` Zlatko Calusic
1998-07-24 21:55 ` Rik van Riel
1998-07-25 13:05 ` Zlatko Calusic
1998-07-27 10:54 ` Stephen C. Tweedie
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=19980723211222.37937@boole.suse.de \
--to=werner@suse.de \
--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