Messages in this thread | | | Date | Wed, 18 May 2011 10:08:48 +0900 | From | KOSAKI Motohiro <> | Subject | Re: [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.
| |