lkml.org 
[lkml]   [2011]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] vmscan: implement swap token priority decay
>> diff --git a/mm/thrash.c b/mm/thrash.c
>> index 14c6c9f..0c4f0a8 100644
>> --- a/mm/thrash.c
>> +++ b/mm/thrash.c
>> @@ -47,6 +47,9 @@ void grab_swap_token(struct mm_struct *mm)
>> if (!swap_token_mm)
>> goto replace_token;
>>
>> + if (!(global_faults& 0xff))
>> + mm->token_priority /= 2;
>> +
>
> I personally don't like this kind of checking counter with mask.
> Hmm. How about this ?
>
> ==
> #define TOKEN_AGE_MASK ~(0xff)
> /*
> * If current global_fault is in different age from previous global_fault,
> * Aging priority and starts new era.
> */
> if ((mm->faultstamp& TOKEN_AGE_MASK) != (global_faults& MM_TOKEN_MASK))
> mm->token_priority /= 2;
> ==

OK. will do.




\
 
 \ /
  Last update: 2011-05-18 03:11    [W:0.100 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site