[PATCH] token based thrashing control
authorRik van Riel <riel@redhat.com>
Mon, 23 Aug 2004 05:59:16 +0000 (22:59 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 23 Aug 2004 05:59:16 +0000 (22:59 -0700)
commitd4f9d02b9151b9ff87a950ed42220de4f740d27b
tree58b215108246a04e922e8cea8cb1d1153950d680
parentf09de30ce99733fc534888ecc12a1c0284524c24
[PATCH] token based thrashing control

The following experimental patch implements token based thrashing
protection, using the algorithm described in:

http://www.cs.wm.edu/~sjiang/token.htm

When there are pageins going on, a task can grab a token, that protects the
task from pageout (except by itself) until it is no longer doing heavy
pageins, or until the maximum hold time of the token is over.

If the maximum hold time is exceeded, the task isn't eligable to hold the
token for a while more, since it wasn't doing it much good anyway.

I have run a very unscientific benchmark on my system to test the
effectiveness of the patch, timing how a 230MB two-process qsbench run
takes, with and without the token thrashing protection present.

normal 2.6.8-rc6: 6m45s
2.6.8-rc6 + token: 4m24s

This is a quick hack, implemented without having talked to the inventor of
the algorithm.  He's copied on the mail and I suspect we'll be able to do
better than my quick implementation ...

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/sched.h
include/linux/swap.h
kernel/fork.c
mm/Makefile
mm/filemap.c
mm/memory.c
mm/rmap.c
mm/thrash.c [new file with mode: 0644]