Re: memcpy and prefetch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux