Re: [PATCH] 2.3.99-pre6-3+ VM rebalancing

From: Jeff Garzik (
Date: Tue Apr 25 2000 - 13:59:50 EST

Simon Kirby wrote:
> Hrmm.. I guess the ideal solution would be that swappable pages would age
> just like cache pages and everything else? Then, if a particular
> program's page hasn't been accessed for 60 seconds and there is nothing
> older in the page cahce, it would swap out...

Again a policy decision... I think such a feature should be present and
enabled by default, but there are some people who would prefer that
their configuration not do this, or would prefer that the timeout for
old pages be far longer than 60 seconds.

The main reason is there is a noticeable performance increase when you
have so much more physical memory available for page and buffer cache.
I manually force this behavior now with the attached 'fillmem' program,
usually before a big compile on an otherwise quiet machine.


Jeff Garzik              | Nothing cures insomnia like the
Building 1024            | realization that it's time to get up.
MandrakeSoft, Inc.       |        -- random fortune

#include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h>

#define MEGS 140 #define MEG (1024 * 1024)

int main (int argc, char *argv[]) { void **data; int i, r; size_t megs = MEGS;

if ((argc >= 2) && (atoi(argv[1]) > 0)) megs = atoi(argv[1]);

data = malloc (megs * sizeof (void*)); if (!data) abort();

memset (data, 0, megs * sizeof (void*));


for (i = 0; i < megs; i++) { data[i] = malloc(MEG); memset (data[i], i, MEG); printf("malloc/memset %03d/%03lu\n", i+1, megs); } for (i = megs - 1; i >= 0; i--) { r = rand() % 200; memset (data[i], r, MEG); printf("memset #2 %03d/%03lu = %d\n", i+1, megs, r); } printf("done\n"); return 0; }

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:10 EST