[haiku-development] Re: Networking speed

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 18 Jul 2008 02:02:25 +0200

Ingo is currently occupying my laptop, so I'm now writing this from Ingo's 
laptop (and his Beam installation/configuration).

On 2008-07-17 at 23:40:36 [+0200], Oliver Tappe <zooey@xxxxxxxxxxxxxxx> wrote:
> But before I start, I'd like to ask everyone if you already know about
> specific problems/weaknesses in the net stack (or elsewhere in the kernel!)
> that could explain the slowness.

Well, it would certainly help to know what happens in these tests, but there 
are at least a couple of things that may slow it down quite a lot under 
certain situations (off of the top of my head):
* For some reason, Hugo introduced a thread per interface that collects the 
outgoing packets to send them further. I currently don't remember if this 
only happens in the local case, but in any way, this means that there are 
many more context switches per packet that one would like to have. I bet that 
this is the most effective speed killer in the current stack.
Previously, the stack processed receceiving of outgoing local data in the 
sender thread which worked just fine (but might now need some locking 
changes, at least that could happen).
* The net_buffer implementation has never been tested for speed, and certain 
use cases could be pretty slow.
* Local connections could use a lot of optimizations (like omitting the lower 
layers), none of those are currently implemented. A better test for day to 
day performance would therefore be remote tests, even though the networking 
driver could have a big effect on the outcome (but nothing unfixable, anyway, 
and the differences between different drivers could also be very interesting).
* Hugo also introduced an ipv4_datagram layer that actually doesn't have any 
functionality but is just another layer data packets have to pass.
* Our current ethernet driver interface is pretty bad, too, as it causes just 
another unnecessary copy of the data; it would be better if we could hand the 
net_buffers to the hardware directly (but that definitely doesn't affect 
local transfers ;-)).

There might be more if I spend more time searching, but I guess I gave you 
some pointers to look at :-)
For the changes Hugo made, the commit messages, as well as the subsequent 
discussions on the commit and networking lists might give you some insight 
behind the motivations for the changes he made.

Bye,
   Axel.

Other related posts: