Re: [PATCH] mm/filemap.c: unconditionally call mark_page_accessed

Rik van Riel
2007-03-16T04:09:55Z

Valdis.Kletnieks@vt.edu wrote:

> On the other hand, Andreas suggested only marking it once every 32 calls,
> but that required a helper variable. Statistically, jiffies%32 should
> end up about the same as a helper variable %32.
>
> This of course, if just calling mark_page_accessed() is actually expensive
> enough that we don't want to do it unconditionally.

Not caching a needed page and having to wait for a disk seek
to complete will be *way* more expensive than any call to
mark_page_accessed().

A modern CPU can do somewhere on the order of 50 million
instructions in the time it takes to bring one page in from
disk.

However, this does not mean we should unconditionally call
mark_page_accessed(), since that could cause use to push
wanted data out of the cache because of one program that
does its streaming accesses in a strange way...

This is a situation where getting it right almost certainly
matters.

--
Politics is the struggle between those who want to make their country
the best in the world, and those who believe it already is. Each group
calls the other unpatriotic.