performance: memcpy vs. __copy_tofrom_user

Paul Mackerras paulus at
Thu Oct 9 13:36:41 EST 2008

Scott Wood writes:

> I'm not sure why we don't use dcbt in memcpy(), as it's just ignored if 
> the memory is cache-inhibited.

Both dcbt and dcbz tend to slow things down if the relevant block is
already in the cache.  Since the kernel memcpy is mostly used for
copies that are only 1 or a small number of cache lines long, it's not
clear that the benefit of dcbt and/or dcbz would outweigh the cost.
And anyway, I have yet to be convinced that optimizing memcpy would
provide a measureable benefit.


More information about the Linuxppc-embedded mailing list