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

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

Advertisement

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

Filename:/mm/swap.c
Lines Added:10
Lines Deleted:4
Also changed in: (Previous) 2.4.12-ac2  2.4.12-ac1  2.4.10-ac12  2.4.10-ac11  2.4.10-ac10  2.4.10-ac9 
(Following) 2.4.13-pre4  2.4.13-pre5  2.4.13-pre6  2.4.13  2.4.13-ac1  2.4.13-ac2 

Location
[  2.4.13-pre3
  [  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 15 15:37:27 2001
@@ -130,11 +130,17 @@
  */
 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))
+   else if (megs < 32)
       page_cluster = 3;
-   else
+   else if (megs < 64)
       page_cluster = 4;
+   else if (megs < 128)
+      page_cluster = 5;
+   else
+      page_cluster = 6;
 }


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