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

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

Advertisement

Kernel v2.4.13 /mm/swap.c

Filename:/mm/swap.c
Lines Added:11
Lines Deleted:7
Also changed in: (Previous) 2.4.13-pre6  2.4.13-pre5  2.4.13-pre4  2.4.13-pre3  2.4.12-ac6  2.4.12-ac4 
(Following) 2.4.13-ac1  2.4.13-ac2  2.4.13-ac3  2.4.13-ac4  2.4.13-ac5  2.4.13-ac6 

Location
[  2.4.13
  [  mm
     o  swap.c

Patch

diff -u --recursive --new-file v2.4.12/linux/mm/swap.c linux/mm/swap.c
--- v2.4.12/linux/mm/swap.c   Sun Sep 23 11:41:01 2001
+++ linux/mm/swap.c   Mon Oct 22 14:27:41 2001
@@ -48,7 +48,7 @@
  * called on a page which is not on any of the lists, the
  * page is left alone.
  */
-void deactivate_page_nolock(struct page * page)
+static inline void deactivate_page_nolock(struct page * page)
 {
    if (PageActive(page)) {
       del_page_from_active_list(page);
@@ -66,7 +66,7 @@
 /*
  * Move an inactive page to the active list.
  */
-void activate_page_nolock(struct page * page)
+static inline void activate_page_nolock(struct page * page)
 {
    if (PageInactive(page)) {
       del_page_from_inactive_list(page);
@@ -130,11 +130,15 @@
  */
 void __init swap_setup(void)
 {
-   /* Use a smaller cluster for memory <16MB or <32MB */
-   if (num_physpages < ((16 * 1024 * 1024) >> PAGE_SHIFT))
+   unsigned long megs = num_physpages >> (20 - PAGE_SHIFT);
+
+   /* Use a smaller cluster for small-memory machines */
+   if (megs < 16)
       page_cluster = 2;
-   else if (num_physpages < ((32 * 1024 * 1024) >> PAGE_SHIFT))
-      page_cluster = 3;
    else
-      page_cluster = 4;
+      page_cluster = 3;
+   /*
+    * Right now other parts of the system means that we
+    * _really_ don't want to cluster much more
+    */
 }


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