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

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

Advertisement

Kernel v2.1.132 /mm/swap.c

Filename:/mm/swap.c
Lines Added:19
Lines Deleted:0
Also changed in: (Previous) 2.1.131  2.1.130  2.1.121  2.1.117  2.1.116  2.1.107 
(Following)

Location
[  2.1.132
  [  mm
     o  swap.c

Patch

diff -u --recursive --new-file v2.1.131/linux/mm/swap.c linux/mm/swap.c
--- v2.1.131/linux/mm/swap.c   Wed Dec 16 10:32:56 1998
+++ linux/mm/swap.c   Sun Dec 20 05:51:07 1998
@@ -39,6 +39,9 @@
    144   /* freepages.high */
 };
 
+/* How many pages do we try to swap or page in/out together? */
+int page_cluster = 4; /* Default value modified in swap_setup() */
+
 /* We track the number of pages currently being asynchronously swapped
    out, so that we don't try to swap TOO many pages out at once */
 atomic_t nr_async_pages = ATOMIC_INIT(0);
@@ -77,3 +80,19 @@
    SWAP_CLUSTER_MAX,   /* minimum number of tries */
    SWAP_CLUSTER_MAX,   /* do swap I/O in clusters of this size */
 };
+
+
+/*
+ * Perform any setup for the swap system
+ */
+
+void __init swap_setup(void)
+{
+   /* Use a smaller cluster for memory <16MB or <32MB */
+   if (num_physpages < ((16 * 1024 * 1024) >> PAGE_SHIFT))
+      page_cluster = 2;
+   else if (num_physpages < ((32 * 1024 * 1024) >> PAGE_SHIFT))
+      page_cluster = 3;
+   else
+      page_cluster = 4;
+}


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