From: Matt Sealey <matt@genesi-usa.com>
To: benh@kernel.crashing.org
Cc: linuxppc-dev@ozlabs.org, Dominik Bozek <domino@mikroswiat.pl>,
Paul Mackerras <paulus@samba.org>,
linuxppc-embedded@ozlabs.org
Subject: Re: performance: memcpy vs. __copy_tofrom_user
Date: Sat, 11 Oct 2008 21:05:49 -0500 [thread overview]
Message-ID: <48F15B7D.3060608@genesi-usa.com> (raw)
In-Reply-To: <1223764226.8157.182.camel@pasglop>
Benjamin Herrenschmidt wrote:
> On Thu, 2008-10-09 at 10:37 -0500, Matt Sealey wrote:
>> Ahem, but nobody here wants AltiVec in the kernel do they?
>
> It depends. We do use altivec in the kernel for example for
> RAID accelerations.
>
> The reason where we require a -real-good- reason to do it is
> simply because of the drawbacks. The cost of enabling altivec
> in the kernel can be high (especially if the user is using it)
> and it's not context switched for kernel code (just like the
> FPU) for obvious performance reasons. Thus any use of altivec in the
> kernel must be done within non-preemptible sections, which can
> cause higher latencies in preemptible kernels.
Would the examples (page copy, page clear) be an okay place to do it?
These sections can't be preempted anyway (right?), and it's noted that
doing it with AltiVec is a tad faster than using MMU tricks or standard
copies?
In Scott's case, while "optimizing memcpy for 48byte blocks" was a joke,
this is 3 load/stores in AltiVec, which as long as every SKB is 16
byte aligned (is there any reason why it would not be? :)
skb_clone might not be something you want to dump AltiVec into and would
make a mess if an skb got extended somehow, but the principle is outlined
in a very good document from a very long time ago;
http://www.motorola.com.cn/semiconductors/sndf/conference/PDF/AH1109.pdf
I think a lot of it still holds true as long as you really don't care
about preemption under these circumstances (where network throughput
is more important, and where AltiVec actually *reduces* CPU time, the
overhead of disabling preemption is lower anyway). You could say the
same about the RAID functions - I bet LatencyTOP has a field day when
you're using RAID5 AltiVec. But if you're more concerned about fast disk
access, would you really care (especially since the algorithm is
automatically selected on boot, you've not much chance of having any
choice in the matter anyway)?
Granted it also doesn't help Scott one bit. Sorry :D
--
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations
next prev parent reply other threads:[~2008-10-12 2:06 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 [this message]
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=48F15B7D.3060608@genesi-usa.com \
--to=matt@genesi-usa.com \
--cc=benh@kernel.crashing.org \
--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.