LinuxMM:

When a VM system is under high load, the system throughput can dramatically decrease; in fact, it can degrade so badly that all processes are spending the majority of their time waiting for the disk instead of running, this situation is known as thrashing. The swap token mechanism can help a system avoid and recover from that situation.

Introduction

The classical method of reducing thrashing is a BSD style memory scheduler, which limits the number of processes that run simultaneously by temporarily suspending some processes completely. While this is guaranteed to reduce the amount of pressure on the VM subsystem, it provides no guarantee that any of the processes in the system are able to make progress. Furthermore, while a properly tuned memory scheduler provides good results, it is hard to tune it right - and an untuned memory scheduler could easily make the situation worse, instead of improving things.

In contrast to the BSD memory scheduler, the swap token method does nothing to reduce the load on the VM subsystem. Instead, it temporarily gives immunity from pageout to one process, allowing that process to make progress. By giving out the swap token in turns, every process in the system gets a fair chance at making progress. This way the system can recover from a thrashing situation.

For more information, see the [http://www.cs.wm.edu/~sjiang/token.pdf Simple token based thrashing protection] paper by Song Jiang.

The problem

While an untuned swap token implementation (like that in the 2.6.11 kernel) already provides large benefits under heavy system load, it has a detrimental effect on performance when the load on the system is very low. In fact, because of this negative effect the swap token mechanism is disabled by default.

This means there are a lot of things left to do (copied from a kernelnewbies email Rik wrote):

Chances are there is a lot of interesting interesting research left to do around the swap token mechanism. Interesting research because the actual code needed for most of these policy changes should be relatively small, but getting them right will require a lot of careful analysis and measurement.

LinuxMM: SwapTokenTuning (last edited 2005-04-22 02:38:28 by fangorn)