Re: sendfile+zerocopy: fairly sexy (nothing to do with ECN)

From: jamal (
Date: Sat Jan 27 2001 - 07:43:31 EST

On Sat, 27 Jan 2001, Andrew Morton wrote:

> (Please keep netdev copied, else Jamal will grump at you, and
> you don't want that).

Thanks, Andrew ;-> Isnt netdev where networking stuff should be
discussed? I think i give up and will join lk, RSN ;->

> The kernels which were tested were 2.4.1-pre10 with and without the
> zerocopy patch. We only look at client load (the TCP sender).
> The link throughput was 11.5 mbytes/sec at all times (saturated 100baseT)
> 2.4.1-pre10-vanilla, using sendfile(): 29.6% CPU
> 2.4.1-pre10-vanilla, using read()/write(): 34.5% CPU
> 2.4.1-pre10+zercopy, using sendfile(): 18.2% CPU
> 2.4.1-pre10+zercopy, using read()/write(): 38.1% CPU
> 2.4.1-pre10+zercopy, using sendfile(): 22.9% CPU * hardware tx checksums disabled
> 2.4.1-pre10+zercopy, using read()/write(): 39.2% CPU * hardware tx checksums disabled
> What can we conclude?
> - sendfile is 10% cheaper than read()-then-write() on 2.4.1-pre10.
> - sendfile() with the zerocopy patch is 40% cheaper than
> sendfile() without the zerocopy patch.

It is also useful to have both client and server stats.
BTW, since the laptop (with the 3C card) is the client, the SG
shouldnt kick in at all.

> - hardware Tx checksums don't make much difference. hmm...
> Bear in mind that the 3c59x driver uses a one-interrupt-per-packet
> algorithm. Mitigation reduces this to 0.3 ints/packet.
> So we're absorbing 4,500 interrupts/sec while processing
> 12,000 packets/sec. gigE NICs do much better mitigation than
> this and the relative benefits of zerocopy will be much higher
> for these. Hopefully Jamal can do some testing.

I dont have my babies right now, but as soon as i can get access to

> BTW: I could not reproduce Jamal's oops when sending large
> files (2 gigs with sendfile()).

Alexey was concerned about this. Good. But maybe it will still
happen with my setupo. We'll see.

> The test tool is, of course, documented [ :-)/2 ]. It's at

I'll give this a shot later. Can you try with the sendfiled-ttcp?
Anyways, you are NIC-challenged ;-> Get GigE. 100Mbps doesnt give
much information.


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

This archive was generated by hypermail 2b29 : Wed Jan 31 2001 - 21:00:27 EST