Re: [PATCH] [RFC] Throttle swappiness for interactive tasks

Rik van Riel
2007-04-19T07:11:21Z

Abhijit Bhopatkar wrote:

> In my mind i find it fundamentally wrong to separate anon pages from
> page cache. It should rather be lot more dependent on which task
> accessed them last. Although it seems due to some twisted relationships
> bet anon pages and interactive tasks separating them improves it.
> Am i missing something here?

The IO cost for anonymous (and other swap backed) pages is
completely different from the IO cost of file system backed
pages.

On file systems, data is typically grouped together on disk
by related content. Programs often access data linearly,
meaning that with readahead we can load a lot of pages into
memory with only a few disk seeks.

Anonymous memory does not have this benefit. For one, memory
tends to get written to swap by LRU order, not by related
content. To make things worse, repeated malloc/free cycles
can cause the memory adjacant to each other inside a process
to be completely unrelated, making virtual address based
swap clustering less useful.

The goal of page replacement is to minimize the total time
spent waiting on page faults. This is not exactly the same
as minimizing the total number of page faults.

> Can you send me those patches please or point me to where i can find those?

You can get the latest one here: