Commit 45ebb840 authored by KOSAKI Motohiro's avatar KOSAKI Motohiro Committed by Linus Torvalds

mm: swap-token: add a comment for priority aging

Document some swap token aging design decisions.
Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: default avatarRik van Riel <riel@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 53bb01f5
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment