Subject: Re: CVS commit: syssrc/sys/arch/arm/arm32
To: None <thorpej@wasabisystems.com>
From: Richard Earnshaw <rearnsha@arm.com>
List: tech-kern
Date: 10/18/2001 18:51:08
> On Thu, Oct 18, 2001 at 06:20:57PM +0100, Richard Earnshaw wrote:
> 
>  > We aren't in pmap_enter.  This is pmap_pinit, which is called from 
>  > pmap_create().  As far as I can tell, there is no mechanism for this to 
>  > fail.
> 
> Ah, yes, pmap_create() is allowed to sleep...  So, this is okay, then...
> 
> But a further improvement might be to allocate the L1 table when it
> is first referenced in pmap_enter(), and release it when the last
> reference to it goes away (via a mapping removal).  This would allow
> a process to give up a precious L1 table for another process that
> needs it when memory is extremely scarce (e.g. give it up when the
> process is swapped out -- see pmap_collect()).

I don't think we could do that; before we can switch to the pmap for the 
first time we have to map in the vectors page, which would require the L1 
page to be present.

Also, note one of the other bugs I fixed today; pmap_collect isn't told 
(and as far as I can see) has no way of establishing if the pmap is shared 
with another process (created by vfork); unmapping the vectors page (which 
would be necessary before we could release the L1 pt) if there is another 
process sharing the L1 pt is highly detrimental to the health of the 
system.

Later arm processors (sa1110, though not SA110, arm720T, arm9, arm10 & 
Xscale) have the option to locate the vectors to 0xffff0000; which is in 
the kernel pmap space.  On these machines we could move the vectors up 
there and then safely recycle L1 PTs.

R.