Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/sys/uvm Pullup rev 1.60 (requested by simonb in ticket ...



details:   https://anonhg.NetBSD.org/src/rev/c2e5f83161da
branches:  netbsd-2-0
changeset: 562780:c2e5f83161da
user:      jmc <jmc%NetBSD.org@localhost>
date:      Fri Oct 08 03:25:21 2004 +0000

description:
Pullup rev 1.60 (requested by simonb in ticket #908)

- Dont let pagedaemon sleep while draining buf.
- Estimate amount of memory to free at a time.
- Factor out code to set watermark and ensure high > low.
- Make the step of allocation possibility a bit seamless by moving the origin
  of curve from 0 to lowater mark.
Improves interactive performance when there is heavy disk activity.
PR#27057

diffstat:

 sys/uvm/uvm_pdaemon.c |  23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diffs (65 lines):

diff -r d62ea2b9a4ba -r c2e5f83161da sys/uvm/uvm_pdaemon.c
--- a/sys/uvm/uvm_pdaemon.c     Fri Oct 08 03:25:15 2004 +0000
+++ b/sys/uvm/uvm_pdaemon.c     Fri Oct 08 03:25:21 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pdaemon.c,v 1.59 2004/03/24 07:55:01 junyoung Exp $        */
+/*     $NetBSD: uvm_pdaemon.c,v 1.59.2.1 2004/10/08 03:25:21 jmc Exp $ */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.59 2004/03/24 07:55:01 junyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.59.2.1 2004/10/08 03:25:21 jmc Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -197,7 +197,7 @@
 void
 uvm_pageout(void *arg)
 {
-       int npages = 0;
+       int bufcnt, npages = 0;
        UVMHIST_FUNC("uvm_pageout"); UVMHIST_CALLED(pdhist);
 
        UVMHIST_LOG(pdhist,"<starting uvm pagedaemon>", 0, 0, 0, 0);
@@ -226,13 +226,6 @@
                UVMHIST_LOG(pdhist,"  <<WOKE UP>>",0,0,0,0);
 
                /*
-                * The metadata cache drainer knows about uvmexp.free
-                * and uvmexp.freetarg.  We call it _before_ scanning
-                * so that it sees the amount we really want.
-                */
-               buf_drain(0);
-
-               /*
                 * now lock page queues and recompute inactive count
                 */
 
@@ -247,6 +240,14 @@
                        uvmexp.inactarg = uvmexp.freetarg + 1;
                }
 
+               /*
+                * Estimate a hint.  Note that bufmem are returned to
+                * system only when entire pool page is empty.
+                */
+               bufcnt = uvmexp.freetarg - uvmexp.free;
+               if (bufcnt < 0)
+                       bufcnt = 0;
+
                UVMHIST_LOG(pdhist,"  free/ftarg=%d/%d, inact/itarg=%d/%d",
                    uvmexp.free, uvmexp.freetarg, uvmexp.inactive,
                    uvmexp.inactarg);
@@ -276,6 +277,8 @@
 
                uvm_unlock_pageq();
 
+               buf_drain(bufcnt << PAGE_SHIFT);
+
                /*
                 * drain pool resources now that we're not holding any locks
                 */



Home | Main Index | Thread Index | Old Index