1 --- linux-2.6.28/include/linux/swap.h 2011-06-02 13:58:40.469430998 +0200
2 +++ linux-2.6.28.new/include/linux/swap.h 2011-06-02 14:01:57.427730997 +0200
3 @@ -186,7 +186,7 @@ struct swap_list_t {
4 int next; /* swapfile to be used next */
7 -/* Swap 50% full? Release swapcache more aggressively.. */
9 #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
11 /* linux/mm/page_alloc.c */
12 --- linux-2.6.28/mm/memory.c 2011-06-02 13:58:36.577820199 +0200
13 +++ linux-2.6.28.new/mm/memory.c 2011-06-02 14:01:57.423731396 +0200
14 @@ -2356,7 +2356,7 @@ static int do_swap_page(struct mm_struct
15 page_add_anon_rmap(page, vma, address);
18 - if (vm_swap_full() || (vma->vm_flags & VM_LOCKED) || PageMlocked(page))
19 + if ((vma->vm_flags & VM_LOCKED) || PageMlocked(page))
20 remove_exclusive_swap_page(page);
23 --- linux-2.6.28/mm/swapfile.c 2011-06-02 13:58:36.581819801 +0200
24 +++ linux-2.6.28.new/mm/swapfile.c 2011-06-02 14:03:09.848109234 +0200
25 @@ -449,14 +449,9 @@ void free_swap_and_cache(swp_entry_t ent
26 spin_unlock(&swap_lock);
31 - BUG_ON(PagePrivate(page));
32 - one_user = (page_count(page) == 2);
33 - /* Only cache user (+us), or swap space full? Free it! */
34 + /* Not mapped elsewhere, or swap space full? Free it! */
35 /* Also recheck PageSwapCache after page is locked (above) */
36 - if (PageSwapCache(page) && !PageWriteback(page) &&
37 - (one_user || vm_swap_full())) {
38 + if (PageSwapCache(page) && !PageWriteback(page)) {
39 delete_from_swap_cache(page);
42 --- linux-2.6.28/mm/vmscan.c 2011-06-02 13:58:40.341443799 +0200
43 +++ linux-2.6.28.new/mm/vmscan.c 2011-06-02 14:05:27.848682722 +0200
44 @@ -758,7 +758,7 @@ cull_mlocked:
47 /* Not a candidate for swapping, so reclaim swap space. */
48 - if (PageSwapCache(page) && vm_swap_full())
49 + if (PageSwapCache(page))
50 remove_exclusive_swap_page_ref(page);
51 VM_BUG_ON(PageActive(page));
53 @@ -1296,9 +1296,7 @@ static void shrink_active_list(unsigned
54 __count_zone_vm_events(PGREFILL, zone, pgscanned);
55 __count_vm_events(PGDEACTIVATE, pgdeactivate);
56 spin_unlock_irq(&zone->lru_lock);
58 - pagevec_swap_free(&pvec);
60 + pagevec_swap_free(&pvec);
61 pagevec_release(&pvec);