Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.25-git19 /mm/swap.c

Filename:/mm/swap.c
Lines Added:12
Lines Deleted:25
Also changed in: (Previous) 2.6.25-git18  2.6.25-git17  2.6.25-git16  2.6.25-git15  2.6.25-git14  2.6.25-git13 
(Following) 2.6.25-git20  2.6.26-rc1  2.6.26-rc2  2.6.26-rc3  2.6.26-rc3-git7  2.6.26-rc3-git8 

Location
[  2.6.25-git19
  [  mm
     o  swap.c

Patch

diff --git a/mm/swap.c b/mm/swap.c
index aa1139c..91e1944 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -132,34 +132,21 @@ static void pagevec_move_tail(struct pagevec *pvec)
  * Writeback is about to end against a page which has been marked for immediate
  * reclaim.  If it still appears to be reclaimable, move it to the tail of the
  * inactive list.
- *
- * Returns zero if it cleared PG_writeback.
  */
-int rotate_reclaimable_page(struct page *page)
+void  rotate_reclaimable_page(struct page *page)
 {
-   struct pagevec *pvec;
-   unsigned long flags;
-
-   if (PageLocked(page))
-      return 1;
-   if (PageDirty(page))
-      return 1;
-   if (PageActive(page))
-      return 1;
-   if (!PageLRU(page))
-      return 1;
-
-   page_cache_get(page);
-   local_irq_save(flags);
-   pvec = &__get_cpu_var(lru_rotate_pvecs);
-   if (!pagevec_add(pvec, page))
-      pagevec_move_tail(pvec);
-   local_irq_restore(flags);
-
-   if (!test_clear_page_writeback(page))
-      BUG();
+   if (!PageLocked(page) && !PageDirty(page) && !PageActive(page) &&
+       PageLRU(page)) {
+      struct pagevec *pvec;
+      unsigned long flags;
 
-   return 0;
+      page_cache_get(page);
+      local_irq_save(flags);
+      pvec = &__get_cpu_var(lru_rotate_pvecs);
+      if (!pagevec_add(pvec, page))
+         pagevec_move_tail(pvec);
+      local_irq_restore(flags);
+   }
 }
 
 /*


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.