[lkml]   [2003]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] optimize ia32 memmove
Jeremy Fitzhardinge wrote:

>On Tue, 2003-12-30 at 01:58, Linus Torvalds wrote:
>>But then anything that does the loads in ascending order is still ok, so
>>it shouldn't matter - by the time "dest" has been overwritten, the source
>>data has already been read. And all the "memcpy()" implementations had
>>better do that anyway, in order to get nice memory access patterns. "rep
>>movsl" certainly does.

AMD recommends to perform bulk copies backwards: That defeats the hw
prefecher, and results in even better access patterns. Doesn't matter in
this case, memmove is never used for bulk copies.

>A PPC memcpy may end up clearing the destination before reading the
>source (using the cache-line zeroing instruction, to prevent the
>destination from being spuriously read to populate the cache line).
The change is i386 only, no effect on other archs.
I found the unoptimized memmove in oprofiles of dbt2 testruns: slab
contains a few memmoves to keep it's recently used arrays in strict LIFO
order. Typically perhaps 100 bytes.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:59    [W:0.035 / U:1.856 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site