From: Michael Sundius <msundius@cisco.com>
To: David Daney <ddaney@caviumnetworks.com>
Cc: linux-mips@linux-mips.org, "VomLehn, David" <dvomlehn@cisco.com>,
msundius@sundius.com
Subject: Re: memcpy and prefetch
Date: Wed, 28 Jan 2009 11:28:10 -0800 [thread overview]
Message-ID: <4980B1CA.4060505@cisco.com> (raw)
In-Reply-To: <497F93C1.3090401@caviumnetworks.com>
David Daney wrote:
> Michael Sundius wrote:
>> I know this topic has been written about but so excuse me if I am
>> redundant.
>> I saw lots of talk in the archives but I don't know if a solution was
>> ever arrived
>> at. so:
>>
>> what is the current state of the use of prefetch in memcpy()? it
>> seems that
>> it is #undef-ed if CONFIG_DMA_COHERENT is not turned on.
>>
>> is this still because the memcpy does not check to prevent a prefetch of
>> addresses beyond the end of the buffer?
>>
>> If so, what was the reason a solution was abandoned....
>>
>> also has anyone out there written a memcopy that does use prefetch
>> intelligently (for mips32 that is)?
>>
>
> The Cavium OCTEON port overrides the default memcpy and does use
> prefetch. It was recently merged (2.6.29-rc2). Look at octeon-memcpy.S
>
> I have thought that memcpy could be generated by mm/page.c as
> copy_page and clear_page are.
>
> David Daney
David,
thanks!!! that's really useful. I have a few questions tho:
1) So you made this function explicitly for the Octeon. and that is
because you know the cache-line is 128 bytes long
on the octeon? is that right?
2) It seems as though you always prefectch the first cache line.. what
happens if the memcopy is less than 1 cache line long?
wouldn't you risk prefetching beyond the end of the buffer?
3) why do you only do the "pref 0 offset(src)" and not a prefetch for
the destination?
4) on line 244 you check to see if len is less than 128. while on the
other checks you check for (offset)+1
why would you not do the prefetch if len was exactly 256 bytes? (or 128
in the case of line 196)?
thanks.
- - - - - Cisco - - - - -
This e-mail and any attachments may contain information which is confidential,
proprietary, privileged or otherwise protected by law. The information is solely
intended for the named addressee (or a person responsible for delivering it to
the addressee). If you are not the intended recipient of this message, you are
not authorized to read, print, retain, copy or disseminate this message or any
part of it. If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer.
next prev parent reply other threads:[~2009-01-28 19:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-27 23:00 memcpy and prefetch Michael Sundius
2009-01-27 23:07 ` David Daney
2009-01-28 10:37 ` Ralf Baechle
2009-01-28 15:28 ` Atsushi Nemoto
2009-01-28 18:30 ` Ralf Baechle
2009-01-29 12:36 ` Atsushi Nemoto
2009-01-29 15:58 ` Ralf Baechle
2009-01-30 3:39 ` David VomLehn (dvomlehn)
2009-01-30 3:39 ` David VomLehn (dvomlehn)
2009-02-04 21:27 ` Ralf Baechle
2009-02-05 15:31 ` Atsushi Nemoto
2009-01-28 19:28 ` Michael Sundius [this message]
2009-01-28 19:54 ` David Daney
2009-01-28 21:52 ` Chad Reese
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=4980B1CA.4060505@cisco.com \
--to=msundius@cisco.com \
--cc=ddaney@caviumnetworks.com \
--cc=dvomlehn@cisco.com \
--cc=linux-mips@linux-mips.org \
--cc=msundius@sundius.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 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.