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

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

Advertisement

Kernel v2.4.13-pre6 /mm/swap.c

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

Location
[  2.4.13-pre6
  [  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   Wed Oct 17 09:47:36 2001
@@ -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.