Self-modifying code

Joe Petolino petolino%joe at Sun.COM
Sat Jul 16 09:23:13 AEST 1988


>>	Why are an Icache plus a Dcache better than just
>>	a big shared cache as big as both?
>
>In terms of hit/miss ratios, a unified cache is clearly better.

I beg to differ.  We ran a few simulations, comparing split and unified
caches (total cache size in the 32K-512K range), and when the caches were
direct-mapped (i.e. 1-way set-associative) the unified cache performed worse. 
Our guess is that when code and data are forced to co-exist in the same
space, you get a high probability of collision and thrashing.  This effect
went away when we increased the degree of set associativity.  One way to
think about it is that having two (direct-mapped) caches gives you some of
the benefits of set-associativity.  Take this with a grain of NaCl: we only
tried a few test programs, and each was small enough to fit into the cache.

-Joe



More information about the Comp.lang.c mailing list