Subject: Re: pmap_is_referenced() -- not used?
To: Chuck Silvers <chuq@chuq.com>
From: Lars Heidieker <paradoxix@heidieker.de>
List: tech-kern
Date: 01/26/2001 16:37:08
Chuck Silvers wrote:

> On Wed, Jan 24, 2001 at 08:04:56PM -0500, Chuck Cranor wrote:
> > >In my mind, this is how it SHOULD work:
> > >     for (pg on inactive list) {
> > >             if (free target is met)
> > >                     break;
> > >             if (pg is referenced) {
> > >                     /* DO NOT CLEAR REFERENCE! */
> > >                     move page to active list;
> > >             }
> >
> > given the assumptions in UVM (that inactive pages have no mappings)
> > the above if statement should never fire.   that is prob. why chucks
> > deleted this statement in UBC.
>
> yup, that's what I was thinking when I removed it, but I didn't notice
> that the other check wasn't there.
>
> has anyone tried putting back the check that I removed and seeing
> how much of a difference that makes?  I'd try it myself, but I'm
> about as far away from my test machines as I can get while still
> remaining on the same planet.
>
> -Chuck

Another thing that might help ist to put referenced pages at the end of
the active list while scanning the active list.

Thist is what I did with the code in uvm/uvm_pdaemon.c in the function
uvmpd_scan() right at the end...
                /*
                 * If the page has not been referenced since the
                 * last scan, deactivate the page if there is a
                 * shortage of inactive pages.
                 */

                if (inactive_shortage > 0) {
                        if(pmap_clear_reference(p) == FALSE) {
                            /* no need to check wire_count as pg is
"active" */
                            uvm_pagedeactivate(p);
                            uvmexp.pddeact++;
                            inactive_shortage--;
                        } else {
                            TAILQ_REMOVE(&uvm.page_active, p, pageq);
                            TAILQ_INSERT_TAIL(&uvm.page_active, p,
pageq);
                        }
                }