Subject: Re: loaning for read() of regular files
To: Chuck Silvers <chuq@chuq.com>
From: Stephan Uphoff <ups@tree.com>
List: tech-kern
Date: 02/16/2005 12:15:36
On Tue, 2005-02-15 at 21:49, Chuck Silvers wrote:
> On Tue, Feb 15, 2005 at 05:00:09PM -0500, Stephan Uphoff wrote:
> > Hi Chuck,
> > 
> > looks great !
> > 
> > You may want to call pmap_remove for failed pmap_enter calls
> > (or remove PMAP_CANFAIL?) to prevent stale page table entries.
> 
> good point, it's not really specified whether a failed pmap_enter(PMAP_CANFAIL)
> that was replacing an existing mapping is required to remove the old mapping
> or not.  we appear to have different behaviour on different platforms.
> 
> I would say that it should always remove the old mapping, since otherwise
> the caller will have to take care of it explicitly anyway.  if everyone
> agrees on this, I'll clarify this in the manpage and see about fixing
> the implementations.

I kind of like the current behaviour (On some platforms :-( ?).

It allows trying to replace one wired mapping with another.
If pmap_enter fails the operation can be retried later with the old
mapping still intact.

Frank van der Linden requested that mappings must be changed atomically
(no time where no page is mapped in the VA) when I did some SMP fixes to
the i386 pmap.
I think he mentioned wired pages when he requested the change but this
was a long time ago.

Stephan