Re: Inlined functions in network code

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

Hi :)

On Sat, Mar 10, 2012 at 01:41, Łukasz Czyż <perlowy.dzem@xxxxxxxxx> wrote:
> Hello
> I implemented stateful IPv6-IPv4 NAT translator which works on top of
> netfilter. It is fully functional now,

congratulations! A nice achievement IMHO.... :) is it merged with
linux kernel mainline?

>I only have a doubt about
> criterion when to declare function as inline. Should all functions
> which are used during packet translation (so they may be called very
> frequently) be inlined?

perhaps network guys know better, but I think inlining as we all know,
prevent code path to do jumps. And that will code execution faster,
especially when it happen many many times (read: millions or more).
And likely they will stay at the same L1 i-cache or at least that's nice too :)

IIRC too, "jmp" will screw branch prediction and sometimes will make
pipeline stall.....So, all in all, it's a matter about speeding about
code path, especially fast path like what you do.


Mulyadi Santosa
Freelance Linux trainer and consultant


Kernelnewbies mailing list

[Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Networking]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux