From: "David S. Miller" <davem@davemloft.net>
To: olof@lixom.net
Cc: andrew.grover@intel.com, netdev@vger.kernel.org
Subject: Re: [PATCH 0/10] [IOAT] I/OAT patches repost
Date: Thu, 20 Apr 2006 20:42:00 -0700 (PDT) [thread overview]
Message-ID: <20060420.204200.103377406.davem@davemloft.net> (raw)
In-Reply-To: <20060421030426.GM26746@pb15.lixom.net>
From: Olof Johansson <olof@lixom.net>
Date: Thu, 20 Apr 2006 22:04:26 -0500
> On Thu, Apr 20, 2006 at 05:27:42PM -0700, David S. Miller wrote:
> > Besides the control overhead of the DMA engines, the biggest thing
> > lost in my opinion is the perfect cache warming that a cpu based copy
> > does from the kernel socket buffer into userspace.
>
> It's definitely the easiest way to always make sure the right caches
> are warm for the app, that I agree with.
>
> But, when warming those caches by copying, the data is pulled in through
> a potentially cold cache in the first place. So the cache misses are
> just moved from the copy loop to userspace with dma offload. Or am I
> missing something?
Yes, and it means that the memory bandwidth costs are equivalent
between I/O AT and cpu copy.
In the cpu copy case you eat the read cache miss, but on the write
side you'll prewarm the cache properly. In the I/O AT case you
eat the same read cost, but the cache will not be prewarmed, so you'll
eat the read cache miss in the application. It's moving the same
exact cost from one place to another.
The time it takes to get the app to make forward progress (meaning
returned from the recvmsg() system call and back in userspace) must by
definition take at least as long with I/O AT as it does with cpu
copies. Yet in the I/O AT case, the application must wait that long
and also then take in the delays of the cache misses when it tries to
read the data that the I/O AT engine copied. Instead of eating the
cache miss cost in the kernel, we eat it in the app because in the I/O
AT case the cpu won't have the user data fresh and loaded into the cpu
cache.
And I say I/O AT must take "at least as long" as cpu copies because
the same memory copy cost is there, and on top of that I/O AT has to
program the DMA controller and touch a _lot_ of other state to get
things going and then wake the task up. We're talking non-trivial
overheads like grabbing the page mappings out of the page tables using
get_user_pages(). Evgivny has posted some very nice performance graphs
showing how poorly that function scales.
This is basically why none of the performance gains add up to me. I
am thus very concerned that the current non-cache-warming
implmentation may fall flat performance wise.
next prev parent reply other threads:[~2006-04-21 3:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-20 20:49 [PATCH 0/10] [IOAT] I/OAT patches repost Andrew Grover
2006-04-20 21:33 ` Olof Johansson
2006-04-20 22:14 ` Andrew Grover
2006-04-20 23:33 ` Olof Johansson
2006-04-21 0:44 ` David S. Miller
2006-04-21 3:09 ` Olof Johansson
2006-04-21 0:38 ` David S. Miller
2006-04-21 1:02 ` Rick Jones
2006-04-21 2:23 ` Herbert Xu
2006-04-21 0:27 ` David S. Miller
2006-04-21 1:00 ` Rick Jones
2006-04-21 1:13 ` David S. Miller
2006-04-21 17:12 ` Rick Jones
2006-04-27 23:49 ` Chris Leech
2006-04-27 23:53 ` Rick Jones
2006-04-21 3:04 ` Olof Johansson
2006-04-21 3:42 ` David S. Miller [this message]
2006-04-21 4:42 ` Olof Johansson
2006-04-27 23:45 ` Chris Leech
2006-04-21 17:13 ` Ingo Oeser
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=20060420.204200.103377406.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=andrew.grover@intel.com \
--cc=netdev@vger.kernel.org \
--cc=olof@lixom.net \
/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).