Date: Tue, 3 Jun 2014 18:05:50 +0100 From: David Chisnall <theraven@theravensnest.org> To: Adrian Chadd <adrian@FreeBSD.org> Cc: Yong-Hyeon Pyun <pyunyh@gmail.com>, Marcel Moolenaar <marcel@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, Marcel Moolenaar <marcel@xcllnt.net>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org> Subject: Re: svn commit: r266974 - in head/sys: dev/dc dev/fxp dev/mii dev/netmap kern net Message-ID: <D1E5E176-F7BD-4F13-8E09-6843038B162B@theravensnest.org> In-Reply-To: <CAJ-Vmomt%2BHN7veD79a7h%2Bv9P4R6LdhAJpRB79yjwGd3H%2BdSpow@mail.gmail.com> References: <201406021754.s52Hsd1B039620@svn.freebsd.org> <CAJ-VmonRqXrzrqQys_9s7-o8DFmOE_c_BZWupezm0i%2BW7E09vA@mail.gmail.com> <CAJ-VmonDJCLYWBPiz1ntFRm8aj4WQd5iHMKK0Wm3hcdjZmxghw@mail.gmail.com> <DA4CB2BA-A551-47A4-9E44-766FA29E2EF2@xcllnt.net> <20140603012939.GA2998@michelle.cdnetworks.com> <CAJ-Vmomt%2BHN7veD79a7h%2Bv9P4R6LdhAJpRB79yjwGd3H%2BdSpow@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 3 Jun 2014, at 06:01, Adrian Chadd <adrian@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D1E5E176-F7BD-4F13-8E09-6843038B162B>