[PATCH] swap 4/4 redundant SwapCache checks

From: Hugh Dickins (hugh@veritas.com)
Date: Tue Jun 11 2002 - 22:11:37 EST


PageSwapCache tests whether mapping is &swapper_space, so it's just
a waste of time for __free_pages_ok, balance_classzone, rw_swap_page
and rw_swap_page_nolock to check both mapping and PageSwapCache. And
__free_pages_ok just did lru_cache_del if PageLRU, so don't recheck it.

--- 2.4.19-pre10/mm/page_alloc.c Tue Jun 4 13:54:19 2002
+++ linux/mm/page_alloc.c Tue Jun 11 19:02:30 2002
@@ -88,12 +88,8 @@
                 BUG();
         if (!VALID_PAGE(page))
                 BUG();
- if (PageSwapCache(page))
- BUG();
         if (PageLocked(page))
                 BUG();
- if (PageLRU(page))
- BUG();
         if (PageActive(page))
                 BUG();
         page->flags &= ~((1<<PG_referenced) | (1<<PG_dirty));
@@ -280,8 +276,6 @@
                                         if (page->mapping)
                                                 BUG();
                                         if (!VALID_PAGE(page))
- BUG();
- if (PageSwapCache(page))
                                                 BUG();
                                         if (PageLocked(page))
                                                 BUG();
--- 2.4.19-pre10/mm/page_io.c Tue Jun 11 19:02:30 2002
+++ linux/mm/page_io.c Tue Jun 11 19:02:30 2002
@@ -97,8 +97,6 @@
                 PAGE_BUG(page);
         if (!PageSwapCache(page))
                 PAGE_BUG(page);
- if (page->mapping != &swapper_space)
- PAGE_BUG(page);
         if (!rw_swap_page_base(rw, entry, page))
                 UnlockPage(page);
 }
@@ -113,8 +111,6 @@
         struct page *page = virt_to_page(buf);
         
         if (!PageLocked(page))
- PAGE_BUG(page);
- if (PageSwapCache(page))
                 PAGE_BUG(page);
         if (page->mapping)
                 PAGE_BUG(page);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 15 2002 - 22:00:24 EST