lkml.org 
[lkml]   [1999]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: zero-copy TCP fileserving
On Thu, 3 Jun 1999, Richard B. Johnson wrote:
> > But for the hardware I'm running this on, a checksum + copy takes at least
> > twice the time as a checksum (simple - read vs read/write). And this is
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> No, not at all. With memory-to-memory copy, you are I/O bound. With any
> CPU that runs faster than memory access (anything faster than a
> 486-DX/66), you get the checksumming for free if the code is properly
> written, which Linux's checksum while copy sees to be.

Hmm ?

If your CPU needs to read 100 MByte and then write it back to ram, it does
take twice the time as just reading it. I never said the actual
_performance_ would double by eliminating the copy.

Fact: our HW, while sending TCP on a 100 mbit/s ethernet, spends 70% of
the time in csum_partial_copy. I'd be surprised if the performance of the
transfers wouldn't go up quite alot if that call was eliminated.

> Also DMA (even if it worked) is not free. The wall clock still runs while
> the user-space page(s) are locked into memory.

DMA works. This is the bus scenario in our setup:

1:
Userland has a buffer X to send, causing a tcp_sendmsg.

Processor reads buffer X, checksums it, and writes it back to ram.

Network controller uses s/g DMA from ram to ethernet.

Loop back to 1

Nobody has said anything about DMA being free. But with s/g DMA you save
the _additional_ copy of the skbuf onto the network controller.

Now, by eliminating the ram write, the CPU might actually be able to keep
up with the network controller.

Remember, for big CPU's, this doesn't give a big win on 10/100 MBit setups
maybe, but the scalability factor is still there. Because next year you'll
be running gigabit ethernet and the cpu would be even more loaded.

This is the kind of stuff people designing the BIG systems need to think
of, like Sun and SGI, as well as the embedded designers (like us). Just
because the effect isn't noticeable on the common PC doesn't mean it has
gone away for good in all scenarios.

/Bjorn



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

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