diff options
author | Hideo Aoki <aoki@sdl.hitachi.co.jp> | 2004-10-19 18:36:36 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-19 18:36:36 -0700 |
commit | 1caf076bd632994f89979fcc1584c3457a04ddcd (patch) | |
tree | 30ba3acb2c51c61e6bf3b5509010edd3dc1d48a9 /mm | |
parent | 2850479a63f2505e8d6fdac8e111bbdf82f1bfb9 (diff) | |
download | history-1caf076bd632994f89979fcc1584c3457a04ddcd.tar.gz |
[PATCH] vm thrashing control tuning
This patch adds "swap_token_timeout" parameter in /proc/sys/vm. The
parameter means expired time of token. Unit of the value is HZ, and the
default value is the same as current SWAP_TOKEN_TIMEOUT (i.e. HZ * 300).
Signed-off-by: Hideo Aoki <aoki@sdl.hitachi.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/thrash.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/thrash.c b/mm/thrash.c index 7183937b24e5db..b6b7360a8b347a 100644 --- a/mm/thrash.c +++ b/mm/thrash.c @@ -20,6 +20,7 @@ struct mm_struct * swap_token_mm = &init_mm; #define SWAP_TOKEN_CHECK_INTERVAL (HZ * 2) #define SWAP_TOKEN_TIMEOUT (HZ * 300) +unsigned long swap_token_default_timeout = SWAP_TOKEN_TIMEOUT; /* * Take the token away if the process had no page faults @@ -75,10 +76,10 @@ void grab_swap_token(void) if ((reason = should_release_swap_token(mm))) { unsigned long eligible = jiffies; if (reason == SWAP_TOKEN_TIMED_OUT) { - eligible += SWAP_TOKEN_TIMEOUT; + eligible += swap_token_default_timeout; } mm->swap_token_time = eligible; - swap_token_timeout = jiffies + SWAP_TOKEN_TIMEOUT; + swap_token_timeout = jiffies + swap_token_default_timeout; swap_token_mm = current->mm; } spin_unlock(&swap_token_lock); |