Subject: Re: pmap tweak sanity check
To: Jason R Thorpe <>
From: Richard Earnshaw <>
List: port-arm
Date: 11/12/2002 21:25:19
> On Tue, Nov 12, 2002 at 04:15:25PM -0000, Chris Gilbert wrote:
>  > An optimisation I've just thought of, is it worth adding flags to the
>  > pvh_attrs field of the vm_page_md stuff that indicates that all entries in
>  > this vm_page list are readonly and therefore all cacheable?  that way when
>  > we add a new readonly pv to the list we don't have to walk the list, we
>  > just add it in.
> I'd use counters -- a flag might require a traversal of the list again
> to update the flag.  A counter would not.
> Maybe use:
> 	- kernel-writable
> 	- user-writable
> 	- read-only
> as the counters?  This way you only need to incr/decr the counters, and
> check them for != 0.  Counters should be unsigned, and sprinkle some
> KDASSERT()s in there to detect underflow.

I was pondering whether a 2-bit counter of the number of pv entries would 
actually be useful.  Basically the counter would tell us if we have 1 2 or 
many (=3) entries on the list and we could switch on that -- that would 
take the common cases out of the need for entering a load of loops (in 
fact it might well be possible to eliminate the vac-me-harder calls 
altogether for the non-many cases).