aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRik van Riel <riel@redhat.com>2004-08-22 22:59:16 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-22 22:59:16 -0700
commitd4f9d02b9151b9ff87a950ed42220de4f740d27b (patch)
tree58b215108246a04e922e8cea8cb1d1153950d680 /kernel
parentf09de30ce99733fc534888ecc12a1c0284524c24 (diff)
downloadhistory-d4f9d02b9151b9ff87a950ed42220de4f740d27b.tar.gz
[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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 233dd7f190d68e..601abf6bbbb80a 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -29,6 +29,7 @@
#include <linux/fs.h>
#include <linux/cpu.h>
#include <linux/security.h>
+#include <linux/swap.h>
#include <linux/syscalls.h>
#include <linux/jiffies.h>
#include <linux/futex.h>
@@ -461,6 +462,7 @@ void mmput(struct mm_struct *mm)
spin_unlock(&mmlist_lock);
exit_aio(mm);
exit_mmap(mm);
+ put_swap_token(mm);
mmdrop(mm);
}
}