Missing the AF_BUS
Missing the AF_BUS
Posted Jul 9, 2012 6:02 UTC (Mon) by daniel (guest, #3181)In reply to: Missing the AF_BUS by josh
Parent article: Missing the AF_BUS
Here's a lovely bit:
http://lxr.linux.no/#linux+v3.4.4/net/ipv4/tcp_output.c#L796
This is part of a call chain that goes about 20 levels deep. There is much worse in there. See, that stuff looks plausible and if you listen to the folklore it sounds fast. But it actually isn't, which I know beyond a shadow of a doubt.
Posted Jul 9, 2012 6:53 UTC (Mon)
by daniel (guest, #3181)
[Link] (3 responses)
http://lxr.linux.no/#linux+v3.4.4/net/ipv4/ip_output.c#L799
This code just kills efficiency by a thousand cuts. There is no single culprit, it is just that all that twisting and turning, calling lots of little helpers and layering everything through an skb editing API that successfully confuses the optimizer adds up to an embarrassing amount of overhead. First rule to remember? Function calls are not free. Not at the speeds networks operate these days.
Posted Jul 9, 2012 8:18 UTC (Mon)
by nix (subscriber, #2304)
[Link] (1 responses)
Posted Jul 9, 2012 23:06 UTC (Mon)
by daglwn (guest, #65432)
[Link]
Posted Jul 9, 2012 18:40 UTC (Mon)
by butlerm (subscriber, #13312)
[Link]
Much of the complexity of that function has to do with kernel support for fragmented skbs, which is required for packets that are larger than the page size. That is the sort of thing that would go away if the kernel adopted a kernel page size larger than the hardware page size in cases where the latter is ridiculously small.
I am not sure what the real benefits are of managing everything in terms of 4K pages is on a system with modern memory sizes. Perhaps the idea of managing everything in terms of 64K pages (i.e. in groups of 16 hardware pages) could be revisited. That would dramatically simplify much of the networking code, because support for fragmented skbs could be dropped. No doubt it would have other benefits as well.
Posted Jul 9, 2012 9:11 UTC (Mon)
by gioele (subscriber, #61675)
[Link]
> This is part of a call chain that goes about 20 levels deep. There is much worse in there. See, that stuff looks plausible and if you listen to the folklore it sounds fast. But it actually isn't, which I know beyond a shadow of a doubt.
Don't you have some notes, implementation ideas or performance tests that you want to share with the rest of the kernel community? I'm pretty sure that they would love to hear how to cut in half the CPU overhead of UDP messages without regressions in functionalities.
This kind of impact would surely reduce the battery consumption of mobile applications, so, maybe the main developers will not interested, but devs of mobile-oriented forks like Android will surely be.
Posted Jul 9, 2012 20:26 UTC (Mon)
by butlerm (subscriber, #13312)
[Link]
Missing the AF_BUS
Missing the AF_BUS
Missing the AF_BUS
Missing the AF_BUS
Missing the AF_BUS
Missing the AF_BUS