aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2011-07-25 17:12:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 20:57:08 -0700
commit45ebb840257b060ec54416aebffd9747e210962c (patch)
tree0236eba5f2f420dccae80f97a70192ef965d6f5f /mm
parent53bb01f593d50188c8d638f89db96f9b6b042bcd (diff)
downloadlinux-45ebb840257b060ec54416aebffd9747e210962c.tar.gz
mm: swap-token: add a comment for priority aging
Document some swap token aging design decisions. Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/thrash.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/thrash.c b/mm/thrash.c
index 42ffb017927..e53f7d02c17 100644
--- a/mm/thrash.c
+++ b/mm/thrash.c
@@ -67,6 +67,17 @@ void grab_swap_token(struct mm_struct *mm)
if (!swap_token_mm)
goto replace_token;
+ /*
+ * Usually, we don't need priority aging because long interval faults
+ * makes priority decrease quickly. But there is one exception. If the
+ * token owner task is sleeping, it never make long interval faults.
+ * Thus, we need a priority aging mechanism instead. The requirements
+ * of priority aging are
+ * 1) An aging interval is reasonable enough long. Too short aging
+ * interval makes quick swap token lost and decrease performance.
+ * 2) The swap token owner task have to get priority aging even if
+ * it's under sleep.
+ */
if ((global_faults - last_aging) > TOKEN_AGING_INTERVAL) {
swap_token_mm->token_priority /= 2;
last_aging = global_faults;