--- include/linux/swap.h | 2 +- mm/memory.c | 2 +- mm/swapfile.c | 9 ++++----- mm/vmscan.c | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) Index: linux-2.6.36-ck1/include/linux/swap.h =================================================================== --- linux-2.6.36-ck1.orig/include/linux/swap.h 2010-10-21 10:28:47.322999311 +1100 +++ linux-2.6.36-ck1/include/linux/swap.h 2010-10-21 10:28:47.455993491 +1100 @@ -192,7 +192,7 @@ struct swap_list_t { int next; /* swapfile to be used next */ }; -/* Swap 50% full? Release swapcache more aggressively.. */ +/* Swap 50% full? */ #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) /* linux/mm/page_alloc.c */ Index: linux-2.6.36-ck1/mm/memory.c =================================================================== --- linux-2.6.36-ck1.orig/mm/memory.c 2010-10-21 10:23:47.550123302 +1100 +++ linux-2.6.36-ck1/mm/memory.c 2010-10-21 10:28:47.456993447 +1100 @@ -2747,7 +2747,7 @@ static int do_swap_page(struct mm_struct mem_cgroup_commit_charge_swapin(page, ptr); swap_free(entry); - if (vm_swap_full() || (vma->vm_flags & VM_LOCKED) || PageMlocked(page)) + if ((vma->vm_flags & VM_LOCKED) || PageMlocked(page)) try_to_free_swap(page); unlock_page(page); if (swapcache) { Index: linux-2.6.36-ck1/mm/swapfile.c =================================================================== --- linux-2.6.36-ck1.orig/mm/swapfile.c 2010-10-21 10:23:47.562122777 +1100 +++ linux-2.6.36-ck1/mm/swapfile.c 2010-10-21 10:28:47.457993403 +1100 @@ -316,7 +316,7 @@ checks: scan_base = offset = si->lowest_bit; /* reuse swap entry of cache-only swap if not busy. */ - if (vm_swap_full() && si->swap_map[offset] == SWAP_HAS_CACHE) { + if (si->swap_map[offset] == SWAP_HAS_CACHE) { int swap_was_freed; spin_unlock(&swap_lock); swap_was_freed = __try_to_reclaim_swap(si, offset); @@ -405,7 +405,7 @@ scan: spin_lock(&swap_lock); goto checks; } - if (vm_swap_full() && si->swap_map[offset] == SWAP_HAS_CACHE) { + if (si->swap_map[offset] == SWAP_HAS_CACHE) { spin_lock(&swap_lock); goto checks; } @@ -420,7 +420,7 @@ scan: spin_lock(&swap_lock); goto checks; } - if (vm_swap_full() && si->swap_map[offset] == SWAP_HAS_CACHE) { + if (si->swap_map[offset] == SWAP_HAS_CACHE) { spin_lock(&swap_lock); goto checks; } @@ -734,8 +734,7 @@ int free_swap_and_cache(swp_entry_t entr * Not mapped elsewhere, or swap space full? Free it! * Also recheck PageSwapCache now page is locked (above). */ - if (PageSwapCache(page) && !PageWriteback(page) && - (!page_mapped(page) || vm_swap_full())) { + if (PageSwapCache(page) && !PageWriteback(page)) { delete_from_swap_cache(page); SetPageDirty(page); } Index: linux-2.6.36-ck1/mm/vmscan.c =================================================================== --- linux-2.6.36-ck1.orig/mm/vmscan.c 2010-10-21 10:28:47.190005130 +1100 +++ linux-2.6.36-ck1/mm/vmscan.c 2010-10-21 10:28:47.457993403 +1100 @@ -845,7 +845,7 @@ cull_mlocked: activate_locked: /* Not a candidate for swapping, so reclaim swap space. */ - if (PageSwapCache(page) && vm_swap_full()) + if (PageSwapCache(page)) try_to_free_swap(page); VM_BUG_ON(PageActive(page)); SetPageActive(page);