On 3 Jun 2014, at 06:01, Adrian Chadd <adr...@freebsd.org> wrote:

> I wonder if in the short term we should just use inlines for now, at
> least so the methodization can get done without hurting people on
> ARM/MIPS.

It's probably worth thinking a bit more carefully about the KPI, since it's 
something we'll likely be stuck with for a long time...

If access to a particular field is on the hot path, and you're never going to 
want to do interposition, then the obvious thing to do is have a method that 
returns a pointer to the field so that you can cache it in the caller.  Some 
thought needs to be given there as to whether these things are _Atomic() 
qualified for when we (eventually) move to C11 for the kernel.

For drivers that are compiled into the kernel, there's no issue with making the 
call inline, but if we want to have a stable KBI for modules then that needs to 
be conditional.  I'm a bit wary about things that will introduce significant 
performance differences between things built as modules and compiled into the 
kernel.

Longer term, there's also the possibility of shipping modules as LLVM IR and 
doing install-time specialisation of them against the current kernel, which 
would make avoiding the function call a premature optimisation that we'd have 
to keep living with.

David

_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to