Re: page cache newbie or page cache problem or both ?

From: Stephen C. Tweedie (sct@redhat.com)
Date: Wed Mar 01 2000 - 10:54:23 EST


Hi,

On Tue, 29 Feb 2000 17:58:36 -0600, bhartner@us.ibm.com said:

> If I run dbench 2 one time, I see "Cached:" peak at about 61000 kB during
> the run and then drop back to 15196 kB when dbench completes.

OK. Dbench has created and deleted a whole pile of files. When they
are deleted, the cache memory they occupy is discarded.

> If I run dbench 10 and wait until "MemFree:" is < 10 MB, and then,
> [this may be the important part] kill dbench 10 with <ctrl-c>,
> "Cached:" does not drop back.

That's right. You stopped dbench before it deleted those files, so they
still exist on disk, so there is no reason to flush them from the cache.

> The next run of dbench 2 completes with a throughput of 3.6 MB/sec,
> an 85% decrease.

That's right. You are overwriting the old run's files, so each new
create is also having to do extra work due to the implicit delete of the
old files which were there.

> After the (3.6 MB) dbench 2 completed, "MemFree:" returned to about
> 50000 kB.

> I ran dbench 2 again with only a throughput of 4.81 MB/sec reported.

Odd. Did you check that all the child processes from the initial dbench
were killed by the ^C?

> Is something is not right here ? Why aren't pages being kicked
> out of the cache and being reused if I <ctrl-c> ?

Because the files weren't being deleted. The cache pages _will_ be
reused if the memory is needed for something else, but the kernel has no
reason to arbitrarily evict stuff from the cache just because a program
stops executing.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Mar 07 2000 - 21:00:09 EST