Re: [PATCH 3/3] vmscan: implement swap token priority decay

From: KOSAKI Motohiro
Date: Tue May 17 2011 - 21:09:04 EST


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.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/