From: KOSAKI Motohiro Date: Tue, 26 Jul 2011 00:12:08 +0000 (-0700) Subject: mm: swap-token: add a comment for priority aging X-Git-Tag: v3.12-rc1~5259^2~104 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45ebb840257b060ec54416aebffd9747e210962c;p=kernel%2Fkernel-generic.git mm: swap-token: add a comment for priority aging Document some swap token aging design decisions. Signed-off-by: KOSAKI Motohiro Acked-by: Rik van Riel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/thrash.c b/mm/thrash.c index 42ffb01..e53f7d0 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;