From: Matt Sealey <matt@genesi-usa.com>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org, Dominik Bozek <domino@mikroswiat.pl>,
linuxppc-embedded@ozlabs.org
Subject: Re: performance: memcpy vs. __copy_tofrom_user
Date: Thu, 09 Oct 2008 10:37:55 -0500 [thread overview]
Message-ID: <48EE2553.30903@genesi-usa.com> (raw)
In-Reply-To: <18669.58803.48011.686743@cargo.ozlabs.ibm.com>
Paul Mackerras wrote:
> Dominik Bozek writes:
>
>> Actually I made couple of other tests on that mpc8313. Most of them are
>> to ugly to publish them, but... My problem is that I have to boost the
>> gigabit interface on the mpc8313. I made simple substitution and
>> __copy_tofrom_user was used instead of memcpy. I know, it's wrong, but I
>> speedup that way the network interface for about 10%.
>
> Very interesting. Can you work out where memcpy is being called on
> the network data? I wouldn't have expected that.
It probably is somewhere.. through some weird and wonderful code path that
needs some serious digging to find. At least in 2.4 memcpy was used and
optimizing it (see Freescale's libmotovec benchmarks) did produce a sizable
performance improvement. That, and offloading TCP checksumming to AltiVec
helped a lot.
No help at all on an 8313 but, relevant anyway.
Since then zero copy networking and other fancy things like the DMA
engine API (for intel ioat at least but also there is fsl dma support)
there's less to actually optimize now so you're less likely to see the
same benefits. All these got into mainline because it's essential to
have this kind of architecture to get reasonable speeds out of >gigabit
network links.
> There is actually no strong reason not to use __copy_tofrom_user as
> memcpy, in fact, as long as we are sure that source and destination
> are both cacheable.
I do think there is probably a good benefit in doing things like zeroing
pages in AltiVec and copying entire pages with AltiVec (for instance
when copy-on-write happens in an application) - NetBSD and QNX implement
at least this because it's faster than using the cache management and
works fine on uncacheable pages too (also since you're always aligned to
a page, zeroing 4kb aligned to a 4kb boundary - or whatever your page
size happens to be, the number of errors that can occur are absolutely
tiny and performance can go through the roof).
Ahem, but nobody here wants AltiVec in the kernel do they?
--
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations
next prev parent reply other threads:[~2008-10-09 15:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 14:39 performance: memcpy vs. __copy_tofrom_user Dominik Bozek
2008-10-08 15:31 ` Minh Tuan Duong
2008-10-08 15:39 ` Bill Gatliff
2008-10-08 15:42 ` Grant Likely
2008-10-09 2:34 ` Paul Mackerras
2008-10-09 10:12 ` Dominik Bozek
2008-10-09 11:06 ` Paul Mackerras
2008-10-09 11:41 ` Dominik Bozek
2008-10-09 12:04 ` Leon Woestenberg
2008-10-09 15:37 ` Matt Sealey [this message]
2008-10-11 22:30 ` Benjamin Herrenschmidt
2008-10-12 2:05 ` Matt Sealey
2008-10-12 4:05 ` Benjamin Herrenschmidt
2008-10-13 15:20 ` Scott Wood
2008-10-13 20:50 ` Benjamin Herrenschmidt
2008-10-13 21:03 ` Scott Wood
2008-10-14 2:14 ` Matt Sealey
2008-10-14 2:39 ` Benjamin Herrenschmidt
2008-10-14 15:10 ` Scott Wood
2008-10-15 1:37 ` Matt Sealey
2008-10-10 17:17 ` Dominik Bozek
2008-10-08 17:40 ` Scott Wood
2008-10-09 2:36 ` Paul Mackerras
2008-10-11 22:32 ` Benjamin Herrenschmidt
2008-10-13 15:06 ` Scott Wood
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=48EE2553.30903@genesi-usa.com \
--to=matt@genesi-usa.com \
--cc=domino@mikroswiat.pl \
--cc=linuxppc-dev@ozlabs.org \
--cc=linuxppc-embedded@ozlabs.org \
--cc=paulus@samba.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.