Professional Documents
Culture Documents
MulticoreArchitectureBasics
2005 IT Roadmap
Semiconductors
2005 Roadmap
2007 Roadmap
Intel single core
Intel multicore
Memory hierarchy
~ 1s Cycle
KeyObservations
Access to L1
cache is on order
of 1 cycle
Access to L2 on
order of 1 to 10
cycles
Access to Main
memory ~ 100s
cycles
Access to Disk ~
1000s cycles
Core
~ 1s 10
Cycles
L1 Cache
L2
Cache
~ 100s Cycles
Main
Memory
Magnetic
Disk
~ 1000s Cycles
interconnect
processor
Art of Multiprocessor
Programming
10
Art of Multiprocessor
Programming
11
zzz
Art of Multiprocessor
Programming
12
value
Art of Multiprocessor
Programming
13
Writing to Memory
address, value
Art of Multiprocessor
Programming
14
Writing to Memory
zzz
Art of Multiprocessor
Programming
15
Writing to Memory
ack
Art of Multiprocessor
Programming
16
cache
Art of Multiprocessor
Programming
17
cache
Art of Multiprocessor
Programming
18
cache
Art of Multiprocessor
Programming
19
Cache Hit
?
cache
Art of Multiprocessor
Programming
20
Cache Hit
Yes!
cache
Art of Multiprocessor
Programming
21
Cache Miss
address
No
?
cache
Art of Multiprocessor
Programming
22
Cache Miss
cache
Art of Multiprocessor
Programming
23
Cache Miss
cache
Art of Multiprocessor
Programming
24
26
Cache line
When there is a cache miss, a fixed size block of
consecutive data elements, or line, is copied from
main memory to the cache.
Typical cache line size is 4-128 bytes.
Main memory can be seen as a sequence of lines,
some of which can have a copy in the cache.
27
28
E
C
B
Intel Core 2
Quad Processor
A
C1
C2
Cache Line
CPU1
CPU2
CPU2
False Sharing
Core 0
X[0] = 0
Core 1
X[1] = 0
X[0] = 1
Time
X[1] = 1
False
X[0] =
2 Sharing not an
issue in shared cache
1 0
0
2
It is an issue 1
in 1
separated cache
Or
Data Structure:
add some padding to a data structure or arrays ( just
enough padding generally less than cache line size) so
that threads access data from different cache lines.
34