tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Bloat



> So on a vax or 68xxx inlining and unrolling are probably wins.

Depends.  It probably produces faster code, but it also produces larger
code.  If this makes the difference between running in-core and paging,
it will be a lose.  (How likely is this?  I don't know.  Has anyone
done a size comparison between kernels with inlines and without?)

> - instruction prefetch and decode will continue through an
>   unconditional jump/call (and quite possibly return) without a
>   pipeline stall.  So subroutine call cost is minimal - apart from
>   argument stacking.

Which may be nonexistent.  Inlined routines will usually be leaf
routines, which for architectures that pass arguments in registers
means they don't need a stack frame at all and thus can totally avoid
stacking anything.  (PowerPC is an example; I've got a lot of PPC in my
head these days.)

> My 'gut feeling' is that it isn't worth inlining anything that is
> likely to be longer than the call sequence.

Roughly, that's my feeling too.  But I also recall seeing some code
once where inlining was essential because that code could not do a real
call for some reason - I forget why this was; maybe it didn't have a
stack at that point or something.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index