Subject: Re: replace pa_to_pvh() and pa_to_attribute() macro
To: Garrett D'Amore <garrett_damore@tadpole.com>
From: Simon Burge <simonb@wasabisystems.com>
List: port-mips
Date: 11/23/2005 11:36:12
On Tue, Nov 22, 2005 at 04:22:13PM -0800, Garrett D'Amore wrote:

> In some instances, there could be a hit for not inlining.  There are two
> reasons for this, at least one of which has already been given:
> 
> 1) high function call overhead for some platforms
> 2) for functions that are surrounded by code which doesn't get called
> often, you may have to flush a page from cache to bring in the code for
> said function.  inlining keeps the cache warm for the calling code
> 
> The drawbacks to inlining:
> 
> 1) larger text size
> 2) possible cache-related impact due to code being larger
> 
> For macros (instead of inlining), there is one more potential impact:
> 
> 3) less optimization due to lack of scoping (register scheduling)
> 
> Hope that helps.

I know the general fors-and-againts for inlining.  In this specific case
I meant "does inlining the pa_to_pvh() and pa_to_attribute() functions
give a performance hit or boost over not inlining?", which will require
some benchmarking (and probably on more than one MIPS CPU type, as MIPS
cache organisation vary quite wildly).

Simon.
--
Simon Burge                                   <simonb@wasabisystems.com>
NetBSD Development, Support and Service:   http://www.wasabisystems.com/