Date: | Tue, 7 Jul 2009 14:26:30 -0500 |
---|---|
From: | Dan Gibson <degibson@xxxxxxxx> |
Subject: | Re: [Gems-users] Miss penalty query |
Lyon, Here are my initial thoughts: I'm going to assume the following psuedocode for the swap operation: memcpy(temp,a,sizeof(a)) memcpy(a,b,sizeof(a)) memcpy(b,temp,sizeof(a))
Where a, b, and temp are sized differently depending on the experiment. In particular, I'm going to assume you are using 32-bit load and store operations, and fully complete each step of the above before proceeding to the next.
Contrast with: for all bytes i in a: temp[i] = a[i] a[i] = b[i] b[i] = temp[i] ... which of course is quite a different access pattern. Based on your description, its not possible to know whether and when source/temp/dest occupy different cache lines. For small sizes (e.g. 4 bytes) it seems like they could all live on the same cache line-- in which case I would expect the 'swap' time to be ~ 1 miss. However, in four byte installments, we're talking about 6 operations (3 load, 3 store), each of which has a service time in the L1D (you don't mention your L1D hit latency). Overheads like the L1D tend to become larger as there are more L1D hits (for instance, from increased spatial locality). This will have the effect of increasing (ruby_cycles)/(user_misses), as more time is spent servicing hits.
Lastly, if your impelmentation of the swap changes the size of the instruction footprint based on the size of the swapped elements, e.g. through loop unrolling, you could see additional latency early in the operation from instruction cache misses.
Regards, Dan On Tue, Jul 7, 2009 at 1:51 PM, Lyon Shinseky <lyon.shinseky@xxxxxxxxx> wrote:
-- http://www.cs.wisc.edu/~gibson [esc]:wq! |
[← Prev in Thread] | Current Thread | [Next in Thread→] |
---|---|---|
|
Previous by Date: | Re: [Gems-users] Miss penalty query, Lyon Shinseky |
---|---|
Next by Date: | [Gems-users] What does "istcdisable" means?, junghun lee |
Previous by Thread: | Re: [Gems-users] Miss penalty query, Lyon Shinseky |
Next by Thread: | [Gems-users] Modify the pipeline of SPARC, litbin |
Indexes: | [Date] [Thread] |