X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=mm%2Fthrash.c;h=f4c560b4a2b79862340fe7457af001f8e6141715;hb=fffcb480e4224f25c965b93fa65541bfc7dd732e;hp=eff3c18c33a10ba802b9743c514a83ccd04aaa09;hpb=fce45c1c8a6b5334fa88bbb9b1496b0699d3fef0;p=mv-sheeva.git diff --git a/mm/thrash.c b/mm/thrash.c index eff3c18c33a..f4c560b4a2b 100644 --- a/mm/thrash.c +++ b/mm/thrash.c @@ -57,14 +57,17 @@ void grab_swap_token(void) /* We have the token. Let others know we still need it. */ if (has_swap_token(current->mm)) { current->mm->recent_pagein = 1; + if (unlikely(!swap_token_default_timeout)) + disable_swap_token(); return; } if (time_after(jiffies, swap_token_check)) { - /* Can't get swapout protection if we exceed our RSS limit. */ - // if (current->mm->rss > current->mm->rlimit_rss) - // return; + if (!swap_token_default_timeout) { + swap_token_check = jiffies + SWAP_TOKEN_CHECK_INTERVAL; + return; + } /* ... or if we recently held the token. */ if (time_before(jiffies, current->mm->swap_token_time)) @@ -95,6 +98,7 @@ void __put_swap_token(struct mm_struct *mm) { spin_lock(&swap_token_lock); if (likely(mm == swap_token_mm)) { + mm->swap_token_time = jiffies + SWAP_TOKEN_CHECK_INTERVAL; swap_token_mm = &init_mm; swap_token_check = jiffies; }