public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Dominik Bozek <domino@mikroswiat•pl>
To: Paul Mackerras <paulus@samba•org>
Cc: linuxppc-dev@ozlabs•org, linuxppc-embedded@ozlabs•org
Subject: Re: performance: memcpy vs. __copy_tofrom_user
Date: Fri, 10 Oct 2008 19:17:29 +0200	[thread overview]
Message-ID: <48EF8E29.1020101@mikroswiat.pl> (raw)
In-Reply-To: <18669.58803.48011.686743@cargo.ozlabs.ibm.com>

Paul Mackerras wrote:
> Very interesting.  Can you work out where memcpy is being called on
> the network data?  I wouldn't have expected that.

Ok. I've some results.
I done two test with different MTU. In both cases, about 0.5GB in total
has been transfered over network. Large blocks.
The test didn't trace a "shallow copy", where occasionally memcpy() is
also in use.


1) MTU=1500 (on both host and mpc8313)
* achieved throughput: 22MB/s (from mpc), 16MB/s (to mpc)
* total size of copied data by memcpy() was 37.6MB
* 96% of that has been copied by skb_clone(): 787758 times in blocks of 48B.
* about 3% of that has been copied by skb_copy_bits(): 1013 times, the
block size vary but rather bigger like 1300B.
* about 1% of that has been copied by eth_header(): 80248 times in
blocks of 6B (!!!!).

2) MTU=9000 (on both host and mpc8313)
* achieved throughput: 50MB/s (from mpc), 44MB/s (to mpc)
* total size of copied data by memcpy() was 6.4MB
* 97% of that has been copied by skb_clone(): 134260 times in blocks of 48B.
* 3% (whole rest) has been copied by eth_header(): 32912 times in blocks
of 6B.

Conclusion. Need for optimized memcpy() for blocks 48B and 6B :). Joke.

I said earlier, that I got about 10% boost when I replaced memcpy() by
__copy_tofrom_user(). It was the case with MTU 9000 because I work with
that setting in my environment.

I don't know when __copy_tofrom_user get faster than memcpy on other
cpus than mpc8313, but on mpc8313 48B blocks are more suitable for
__copy_tofrom_user.

Dominik

  parent reply	other threads:[~2008-10-10 17:17 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
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 [this message]
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=48EF8E29.1020101@mikroswiat.pl \
    --to=domino@mikroswiat$(echo .)pl \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    --cc=paulus@samba$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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