X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=mm%2Fthrash.c;h=c4c5205a9c35f82c2dc34b52b4b37a8b0a0ecc44;hb=8713e01295140f674a41f2199b0f7ca99dfb69d5;hp=19e428ca8b034ccae8bb6c201d52197bf17a084e;hpb=7602bdf2fd14a40dd9b104e516fdc05e1bd17952;p=safe%2Fjmp%2Flinux-2.6 diff --git a/mm/thrash.c b/mm/thrash.c index 19e428c..c4c5205 100644 --- a/mm/thrash.c +++ b/mm/thrash.c @@ -24,7 +24,7 @@ static DEFINE_SPINLOCK(swap_token_lock); struct mm_struct *swap_token_mm; -unsigned int global_faults; +static unsigned int global_faults; void grab_swap_token(void) { @@ -48,9 +48,8 @@ void grab_swap_token(void) if (current_interval < current->mm->last_interval) current->mm->token_priority++; else { - current->mm->token_priority--; - if (unlikely(current->mm->token_priority < 0)) - current->mm->token_priority = 0; + if (likely(current->mm->token_priority > 0)) + current->mm->token_priority--; } /* Check if we deserve the token */ if (current->mm->token_priority >