1 The swap token is only useful in conditions of swap thrash, and actually
2 worsens the common case by causing more swapping. Make it only have an effect
3 when swap is more than half full.
8 include/linux/swap.h | 3 ++-
9 1 file changed, 2 insertions(+), 1 deletion(-)
11 Index: linux-2.6.39-ck1/include/linux/swap.h
12 ===================================================================
13 --- linux-2.6.39-ck1.orig/include/linux/swap.h 2011-05-19 16:29:16.642275387 +1000
14 +++ linux-2.6.39-ck1/include/linux/swap.h 2011-05-19 19:36:35.917273667 +1000
15 @@ -358,9 +358,10 @@ extern struct mm_struct *swap_token_mm;
16 extern void grab_swap_token(struct mm_struct *);
17 extern void __put_swap_token(struct mm_struct *);
19 +/* Only allow swap token to have effect if swap is full */
20 static inline int has_swap_token(struct mm_struct *mm)
22 - return (mm == swap_token_mm);
23 + return (mm == swap_token_mm && vm_swap_full());
26 static inline void put_swap_token(struct mm_struct *mm)