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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]