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

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

Advertisement

Kernel v2.1.100 /mm/vmscan.c

Filename:/mm/vmscan.c
Lines Added:20
Lines Deleted:19
Also changed in: (Previous) 2.1.99  2.1.91  2.1.90  2.1.89  2.1.80  2.1.79 
(Following) 2.1.107  2.1.109  2.1.110  2.1.116  2.1.117  2.1.118 

Location
[  2.1.100
  [  mm
     o  vmscan.c

Patch

diff -u --recursive --new-file v2.1.99/linux/mm/vmscan.c linux/mm/vmscan.c
--- v2.1.99/linux/mm/vmscan.c   Sat May  2 14:19:54 1998
+++ linux/mm/vmscan.c   Sat May  2 17:44:59 1998
@@ -455,17 +455,20 @@
    switch (state) {
       do {
       case 0:
-         state = 1;
          if (shrink_mmap(i, gfp_mask))
             return 1;
+         state = 1;
       case 1:
-         state = 2;
          if ((gfp_mask & __GFP_IO) && shm_swap(i, gfp_mask))
             return 1;
-      default:
-         state = 0;
+         state = 2;
+      case 2:
          if (swap_out(i, gfp_mask))
             return 1;
+         state = 3;
+      case 3:
+         shrink_dcache_memory(i, gfp_mask);
+         state = 0;
       i--;
       } while ((i - stop) >= 0);
    }
@@ -545,30 +548,28 @@
       schedule();
       swapstats.wakeups++;
 
-      /* This will gently shrink the dcache.. */
-      shrink_dcache_memory();
-   
       /*
        * Do the background pageout: be
        * more aggressive if we're really
        * low on free memory.
        *
-       * The number of tries is 512 divided by an
-       * 'urgency factor'. In practice this will mean
-       * a value of 512 / 8 = 64 pages at a time,
-       * giving 64 * 4 (times/sec) * 4k (pagesize) =
-       * 1 MB/s in lowest-priority background
-       * paging. This number rises to 8 MB/s when the
-       * priority is highest (but then we'll be woken
-       * up more often and the rate will be even higher).
-       * -- Should make this sysctl tunable...
+       * We try page_daemon.tries_base times, divided by
+       * an 'urgency factor'. In practice this will mean
+       * a value of pager_daemon.tries_base / 8 or 4 = 64
+       * or 128 pages at a time.
+       * This gives us 64 (or 128) * 4k * 4 (times/sec) =
+       * 1 (or 2) MB/s swapping bandwidth in low-priority
+       * background paging. This number rises to 8 MB/s
+       * when the priority is highest (but then we'll be
+       * woken up more often and the rate will be even
+       * higher).
        */
-      tries = (512) >> free_memory_available(3);
+      tries = pager_daemon.tries_base >> free_memory_available(3);
    
       while (tries--) {
          int gfp_mask;
 
-         if (++tried > SWAP_CLUSTER_MAX && free_memory_available(0))
+         if (++tried > pager_daemon.tries_min && free_memory_available(0))
             break;
          gfp_mask = __GFP_IO;
          try_to_free_page(gfp_mask);
@@ -576,7 +577,7 @@
           * Syncing large chunks is faster than swapping
           * synchronously (less head movement). -- Rik.
           */
-         if (atomic_read(&nr_async_pages) >= SWAP_CLUSTER_MAX)
+         if (atomic_read(&nr_async_pages) >= pager_daemon.swap_cluster)
             run_task_queue(&tq_disk);
 
       }


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