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)
{
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 >