Subject: Re: New kinetic figures
To: Neil A. Carson <neil@causality.com>
From: Jason R Thorpe <thorpej@zembu.com>
List: port-arm32
Date: 02/08/2001 12:14:40
On Thu, Feb 08, 2001 at 11:35:45AM -0800, Neil A. Carson wrote:

 > As far as I can recall, when the process dies the number in practice is
 > >3 because of the pmap remove calls for all invididually mapped segments - at least text, data, bss (as you suggest) and probably in practice several others too.
 > 
 > The problem is on pmap remove having to spin rounds loads of stuff and
 > try and optimise the removal several times. FreeBSD has a 'remove all
 > mappings for this pmap' call which would do nicely on process exit; as
 > an aside, on x86 this has the nice effect of a partial cache flush
 > because of the tables, so such a call wins there too :-) So then you
 > could reduce the flushes to 1. Beyond that, there's some other changes
 > you can do to optimise context switching but I can't remember what
 > happened to those patches (I did 80% of the work one time but there were
 > a couple of holes and it never made it back to the repository).

You don't need a separate call.  A separate call is silly.

You can optimize your traversal of the tables in pmap_remove(), and
if you're clever (like the i386 pmap is, esp. in the MP branch kernel),
you can defer all the TLB operations until the end (the i386 just does
a full non-global TLB flush if there are > 16 TLB invalidations pending).

-- 
        -- Jason R. Thorpe <thorpej@zembu.com>