Subject: Re: Non-optimial "access type" handing in pmap_enter()?
To: None <thorpej@wasabisystems.com>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm
Date: 01/31/2002 18:54:30
> Folks...
> 
> While elbow-deep in the pmap to work out the cache issues, I noticed
> that we seem to not handle "access type" quite correctly.
> 
> Take a look at line 2833 of pmap.c,v 1.36.
> 
> What we do here is:
> 
> 	if write access, mark page ref+mod, and allow page writes.
> 	else if read access, mark page ref, and allow read access.
> 	else don't allow any access.
> 
> This is non-optimal for the case where a page is already modified or
> referenced by another mapping.
> 
> Consider the case of libc -- it's likely that many pages will be at least
> referenced, and so when UVM pre-faults pages around an actual faulting
> page (by default, the faulting page is considered the "middle" of a fault
> area, and it also faults in a few pages being and ahead of the middle),
> even though there is no access type passed for those pmap_enter() calls,
> if those pages are already referenced, the redundant page fault should be
> avoided later when they are.  (This is whole point of pre-faulting those
> pages :-)

I suspect this will be a side-effect of having to emulate the read/modify 
bits.  The only way of doing these is to trap accesses to the page and 
enable access.

What are you suggesting the algorithm should be.  Certainly I don't think 
we should grant write permission anywhere that isn't required.

R.