aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAshwin Chaugule <ashwin.chaugule@celunite.com>2006-12-06 23:31:57 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:21 -0500
commit7602bdf2fd14a40dd9b104e516fdc05e1bd17952 (patch)
tree5ca703b0a95f6f2e6d977c816532b9085f453974 /include
parent098fe651f7e9d759d1117c78c1a642b9b3945922 (diff)
[PATCH] new scheme to preempt swap token
The new swap token patches replace the current token traversal algo. The old algo had a crude timeout parameter that was used to handover the token from one task to another. This algo, transfers the token to the tasks that are in need of the token. The urgency for the token is based on the number of times a task is required to swap-in pages. Accordingly, the priority of a task is incremented if it has been badly affected due to swap-outs. To ensure that the token doesnt bounce around rapidly, the token holders are given a priority boost. The priority of tasks is also decremented, if their rate of swap-in's keeps reducing. This way, the condition to check whether to pre-empt the swap token, is a matter of comparing two task's priority fields. [akpm@osdl.org: cleanups] Signed-off-by: Ashwin Chaugule <ashwin.chaugule@celunite.com> Cc: Rik van Riel <riel@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sched.h13
-rw-r--r--include/linux/swap.h1
2 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index eafe4a7b8237..cad6a16260f7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -344,9 +344,16 @@ struct mm_struct {
344 /* Architecture-specific MM context */ 344 /* Architecture-specific MM context */
345 mm_context_t context; 345 mm_context_t context;
346 346
347 /* Token based thrashing protection. */ 347 /* Swap token stuff */
348 unsigned long swap_token_time; 348 /*
349 char recent_pagein; 349 * Last value of global fault stamp as seen by this process.
350 * In other words, this value gives an indication of how long
351 * it has been since this task got the token.
352 * Look at mm/thrash.c
353 */
354 unsigned int faultstamp;
355 unsigned int token_priority;
356 unsigned int last_interval;
350 357
351 /* coredumping support */ 358 /* coredumping support */
352 int core_waiters; 359 int core_waiters;
diff --git a/include/linux/swap.h b/include/linux/swap.h
index e7c36ba2a2db..89f8a39773bf 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -259,7 +259,6 @@ extern spinlock_t swap_lock;
259 259
260/* linux/mm/thrash.c */ 260/* linux/mm/thrash.c */
261extern struct mm_struct * swap_token_mm; 261extern struct mm_struct * swap_token_mm;
262extern unsigned long swap_token_default_timeout;
263extern void grab_swap_token(void); 262extern void grab_swap_token(void);
264extern void __put_swap_token(struct mm_struct *); 263extern void __put_swap_token(struct mm_struct *);
265 264