[lkml]   [2000]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: zero-copy TCP

On Mon, 4 Sep 2000, Jamie Lokier wrote:

> Linus Torvalds wrote:
> > Basically any copy <= 4 cache lines is "free" compared to trying to be
> > clever.
> We're obviously interested in larger packets than 128 bytes.


Take a look at some common traffic. Yes, even in servers.

Small packets are not unlikely.

And even if you add extra code to _not_ do it for small packets, what
you're basically doing is slowing down the path - and increasing your
icache footprint etc quite noticeably, because suddenly you have two
mostly independent paths.

And the bugs get interesting too.

Also, you ignored the fact that the 128 can be 256 or 512. AND you ignored
the fact that I was being very generous indeed to the page table walking
case. So the 128 can end up being quite close to the page size. Or more.

> That's why the data is DMA'd to the card immediately, and that _card_
> retains the data at least for the short term. Long term if it's still
> retained and the card runs out of memory, the card DMAs old buffers back
> to a kernel skbuff. This is one way to avoid TLBs.


And such a card doesn't actually exist. At least not in copious numbers.

You need megabytes of memory to hold stuff like that for a busy server. A
few hundred connections with a few kB of queued-up, unacked data.

Face it, it's not realistic. Sure, such cards exist. How many people have
ever _seen_ one?

> Some people who claim zero-copy is great have done actual measurements
> and it does look good for reasonable size packets. Even though the raw
> performance doesn't look that much better, the CPU utilisation does so
> you can actually _calculate_ a bit more with your data.
> However, I've not seen any evidence that it's a good idea with the
> standard unix APIs. I suspect everyone will agree on that :-)

Blame the API's.

Face it, complexity almost _never_ pays off.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:38    [W:0.110 / U:22.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site