netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: netdev@oss.sgi.com
Cc: modica@sgi.com
Subject: Re: Zero copy transmit
Date: Tue, 29 Apr 2003 22:39:46 +0200	[thread overview]
Message-ID: <20030429203945.GD349@Wotan.suse.de> (raw)
In-Reply-To: <3EAEDBE9.1060405@sgi.com>

> Don't get me wrong, we would certainly drop any notions of this if we 
> found that it was slower and I will be glad to post any results. The 
> goal is to take advantage of the hardware to make things faster.

You have no hardware to make the remote TLB flushes fast ;)

I'm sure you can show it being an advantage with a single threaded process.
But when you run it on a multithreaded application just with two threads
it may look very different.

> Going back to your example above, don't solaris and hpux also do COW for 
> write and send? (I don't have their sources)  If so, why would they do 
> it if it's slower?

I don't know if they do. The only Unix I'm aware of that has zero copy
sendmsg() is NetBSD and their focus does not seem to be SMP scalability.

I observed the problem recently just with swapping a big (10GB) process
whose working set slightly exceeded the available memory.
kswapd was running on one CPU; the process on another. kswapd 
was aging the pages of the memory hog all the time, which requires an unmapping
and a remote TLB flush in the process' page tables. The result 
was that two CPUs were 100% tied up in the kernel, just spinning on the 
page_table_lock of the mm and processing TLB IPIs (spinlock was ~50%; IPI 
overhead 40% or so). I predict that your proposed TLB flushing write will
cause the same problem with lots of writes. It's more or less the same thing,
except that kswapd has a builtin rate limit and runs only on a single CPU 
and write() has not.

Also last time I checked most Linux ports still used an single global
spinlock for the TLB flush IPI. You would add a nice new hot lock
to the network path.

-Andi

  reply	other threads:[~2003-04-29 20:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-29 18:44 Zero copy transmit Steve Modica
2003-04-29 19:20 ` Andi Kleen
2003-04-29 19:33   ` Robin Holt
2003-04-29 19:41     ` Andi Kleen
2003-04-29 19:41   ` Steve Modica
2003-04-29 19:59     ` Andi Kleen
2003-04-29 20:09       ` Steve Modica
2003-04-29 20:39         ` Andi Kleen [this message]
2003-04-30  1:41           ` Michael Richardson
2003-04-30 15:05           ` Robin Holt
2003-04-30 15:29             ` Andi Kleen
2003-04-29 20:17     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030429203945.GD349@Wotan.suse.de \
    --to=ak@suse.de \
    --cc=modica@sgi.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).