Clean up patch dir; synchronize patches with kernel-power v48
[kernel-bfs] / kernel-bfs-2.6.28 / debian / patches / ck / mm-drop_swap_cache_aggressively.patch
diff --git a/kernel-bfs-2.6.28/debian/patches/ck/mm-drop_swap_cache_aggressively.patch b/kernel-bfs-2.6.28/debian/patches/ck/mm-drop_swap_cache_aggressively.patch
new file mode 100644 (file)
index 0000000..9cb60df
--- /dev/null
@@ -0,0 +1,63 @@
+--- linux-2.6.28/include/linux/swap.h  2011-06-02 13:58:40.469430998 +0200
++++ linux-2.6.28.new/include/linux/swap.h      2011-06-02 14:01:57.427730997 +0200
+@@ -186,7 +186,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 */
+--- linux-2.6.28/mm/memory.c   2011-06-02 13:58:36.577820199 +0200
++++ linux-2.6.28.new/mm/memory.c       2011-06-02 14:01:57.423731396 +0200
+@@ -2356,7 +2356,7 @@ static int do_swap_page(struct mm_struct
+       page_add_anon_rmap(page, vma, address);
+       swap_free(entry);
+-      if (vm_swap_full() || (vma->vm_flags & VM_LOCKED) || PageMlocked(page))
++      if ((vma->vm_flags & VM_LOCKED) || PageMlocked(page))
+               remove_exclusive_swap_page(page);
+       unlock_page(page);
+--- linux-2.6.28/mm/swapfile.c 2011-06-02 13:58:36.581819801 +0200
++++ linux-2.6.28.new/mm/swapfile.c     2011-06-02 14:03:09.848109234 +0200
+@@ -449,14 +449,9 @@ void free_swap_and_cache(swp_entry_t ent
+               spin_unlock(&swap_lock);
+       }
+       if (page) {
+-              int one_user;
+-
+-              BUG_ON(PagePrivate(page));
+-              one_user = (page_count(page) == 2);
+-              /* Only cache user (+us), or swap space full? Free it! */
++              /* Not mapped elsewhere, or swap space full? Free it! */
+               /* Also recheck PageSwapCache after page is locked (above) */
+-              if (PageSwapCache(page) && !PageWriteback(page) &&
+-                                      (one_user || vm_swap_full())) {
++              if (PageSwapCache(page) && !PageWriteback(page)) {
+                       delete_from_swap_cache(page);
+                       SetPageDirty(page);
+               }
+--- linux-2.6.28/mm/vmscan.c   2011-06-02 13:58:40.341443799 +0200
++++ linux-2.6.28.new/mm/vmscan.c       2011-06-02 14:05:27.848682722 +0200
+@@ -758,7 +758,7 @@ cull_mlocked:
+ activate_locked:
+               /* Not a candidate for swapping, so reclaim swap space. */
+-              if (PageSwapCache(page) && vm_swap_full())
++              if (PageSwapCache(page))
+                       remove_exclusive_swap_page_ref(page);
+               VM_BUG_ON(PageActive(page));
+               SetPageActive(page);
+@@ -1296,9 +1296,7 @@ static void shrink_active_list(unsigned 
+       __count_zone_vm_events(PGREFILL, zone, pgscanned);
+       __count_vm_events(PGDEACTIVATE, pgdeactivate);
+       spin_unlock_irq(&zone->lru_lock);
+-      if (vm_swap_full())
+-              pagevec_swap_free(&pvec);
+-
++      pagevec_swap_free(&pvec);
+       pagevec_release(&pvec);
+ }