Subject: context switch code
To: None <port-sh3@netbsd.org>
From: Jason R Thorpe <thorpej@zembu.com>
List: port-sh3
Date: 05/24/2000 16:23:19
Hi folks....

I was just in the neighborhood (i.e. making a small modification to
the context switch code of every port) when I noticed something about
the SH3 context switch path...

"There sure are a lot of subroutine calls in there!"

Now, I'm not terribly familiar with the SH3, however it seems as if the
current context switch code could stand some serious improvement.

Looks like what's happening here is that because interrupts are disabled,
you don't get TLB miss exceptions.  Thus, you must convert each virtual
address to a physical address and do the load/store using the physical
address (which is, presumably, direct-mapped when in kernel mode).

Now, if this is indeed the case, then I have good news for you!  :-)

The proc structures are allocated using the pool allocator.  You could
use the PMAP_MAP_POOLPAGE()/PMAP_UNMAP_POOLPAGE() hooks to always use
the direct-mapped pages for object allocated via the pool allocator.

This would allow you to trim out all of the ConvVtoP from the context
switch path.

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