Subject: Re: pmap_is_referenced() -- not used?
To: Chuck Cranor <chuck@xxx.research.att.com>
From: Jason R Thorpe <thorpej@zembu.com>
List: tech-kern
Date: 01/24/2001 18:57:01
On Wed, Jan 24, 2001 at 06:30:12PM -0800, Jason R Thorpe wrote:

 > --- 2566,2571 ----
 > Index: uvm_page_i.h
 > ===================================================================
 > RCS file: /cvsroot/syssrc/sys/uvm/uvm_page_i.h,v
 > retrieving revision 1.15
 > diff -c -r1.15 uvm_page_i.h
 > *** uvm_page_i.h	2001/01/14 02:10:02	1.15
 > --- uvm_page_i.h	2001/01/25 02:24:35
 > ***************
 > *** 193,199 ****
 >   }
 >   
 >   /*
 > !  * uvm_pagedeactivate: deactivate page -- no pmaps have access to page
 >    *
 >    * => caller must lock page queues
 >    * => caller must check to make sure page is not wired
 > --- 193,199 ----
 >   }
 >   
 >   /*
 > !  * uvm_pagedeactivate: deactivate page
 >    *
 >    * => caller must lock page queues
 >    * => caller must check to make sure page is not wired
 > ***************
 > *** 218,225 ****
 >   		pg->pqflags |= PQ_INACTIVE;
 >   		uvmexp.inactive++;
 >   		pmap_clear_reference(pg);
 > - 		if (pmap_is_modified(pg))
 > - 			pg->flags &= ~PG_CLEAN;

Actually, this isn't strictly necessary, and I put it back in, with
the following comment block:

		/*
		 * update the "clean" bit.  this isn't 100%
		 * accurate, and doesn't have to be.  we'll
		 * re-sync it after we zap all mappings when
		 * scanning the inactive list.
		 */

Here are the uvm stats on my machine after doing a bunch of parallel
kernel builds while cat'ing files all over the file system.  In a while,
(after I entertain some dinner guests), I'll try deactivating pages in
ubc_release() again.

     4096 bytes per page
    31421 pages managed
     3672 pages free
    16983 pages active
     6242 pages inactive
        0 pages paging
      965 pages wired
        0 zero pages
        1 reserve pagedaemon pages
        5 reserve kernel pages
     3289 anon pager pages
    20796 vnode page cache pages
       64 minimum free pages
       85 target free pages
     8945 target inactive pages
    10473 maximum wired pages
        1 swap devices
    65519 swap pages
     8222 swap pages in use
     7957 swap allocations
    94892 anons
    85539 free anons
  3298527 total faults taken
  3860485 traps
   449335 device interrupts
   414728 cpu context switches
   622556 software interrupts
  9012543 system calls
     7939 pagein requests
     2302 pageout requests
      499 swap ins
      515 swap outs
        0 pages swapped in
    34978 pages swapped out
    14751 forks total
    11008 forks blocked parent
    11017 forks shared address space with parent
        0 pagealloc zero wanted and avail
  2379160 pagealloc zero wanted and not avail
        0 aborts of idle page zeroing
      506 faults with no memory
        0 faults with no anons
       48 faults had to wait on pages
        0 faults found released page
    14280 faults relock (14267 ok)
   138690 anon page faults
     8023 anon retry faults
   119044 amap copy faults
    57286 neighbour anon page faults
  2353792 neighbour object page faults
   698011 locked pager get faults
     6249 unlocked pager get faults
   110407 anon faults
    28275 anon copy on write faults
   559647 object faults
   138350 promote copy faults
  2280296 promote zero fill faults
     1301 times daemon wokeup
      793 revolutions of the clock hand
      760 times daemon attempted swapout
   130210 pages freed by daemon
   224719 pages scanned by daemon
    55217 anonymous pages scanned by daemon
   109971 object pages scanned by daemon
    11985 pages reactivated
    38738 pages found busy by daemon
     2302 total pending pageouts
   228033 pages deactivated
  5791098 total name lookups
          cache hits (86% pos + 10% neg) system 0% per-process
          deletions 0%, falsehits 0%, toolong 0%