diff options
Diffstat (limited to 'mm/thrash.c')
-rw-r--r-- | mm/thrash.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mm/thrash.c b/mm/thrash.c index 42ffb0179271..e53f7d02c17c 100644 --- a/mm/thrash.c +++ b/mm/thrash.c | |||
@@ -67,6 +67,17 @@ void grab_swap_token(struct mm_struct *mm) | |||
67 | if (!swap_token_mm) | 67 | if (!swap_token_mm) |
68 | goto replace_token; | 68 | goto replace_token; |
69 | 69 | ||
70 | /* | ||
71 | * Usually, we don't need priority aging because long interval faults | ||
72 | * makes priority decrease quickly. But there is one exception. If the | ||
73 | * token owner task is sleeping, it never make long interval faults. | ||
74 | * Thus, we need a priority aging mechanism instead. The requirements | ||
75 | * of priority aging are | ||
76 | * 1) An aging interval is reasonable enough long. Too short aging | ||
77 | * interval makes quick swap token lost and decrease performance. | ||
78 | * 2) The swap token owner task have to get priority aging even if | ||
79 | * it's under sleep. | ||
80 | */ | ||
70 | if ((global_faults - last_aging) > TOKEN_AGING_INTERVAL) { | 81 | if ((global_faults - last_aging) > TOKEN_AGING_INTERVAL) { |
71 | swap_token_mm->token_priority /= 2; | 82 | swap_token_mm->token_priority /= 2; |
72 | last_aging = global_faults; | 83 | last_aging = global_faults; |