Multicore Processors Flashcards
(53 cards)
What is a multicore processor?
- Multiple cores on same die
- Each core capable of running a stream of instructions
- Cores are independent but may work together
- MIMD parallelism
What are the two ways in which we can enable communication between cores?
- Shared memory
- Message passing
Draw a diagram to show 4 cores attached to a shared memory
.
With shared memory: no matter how cores are organised, they all see ? ? values in memory
the same
All cores see shared memory as a ???
single address space
Writes to shared memory by one core are ? seen by others
eventually
Doesn’t have to happen instantly, but reads always get the most recent value
Give 2 advantages of shared memory
+ Different cores can use memory to communicate - one core writes the value that the other reads
+ Shared memory is easy to program because it matches the view the programmers have
When might one core write a value to memory that another core then reads?
If a program that was in the first core is rescheduled to run on the second one
What are the advantages and disadvantages of using shared caches?
+ Good use of space
+ Data shared between cores faster than memory ie. good for applications that share data
- If a process has a large working set it can starve cache resources from other processes
What are the advantages of using private caches?
+ Provide guaranteed space for each core
+ May be faster to access
- Different processes might have different caching requirements
Draw a diagram of 4 cores with a shared memory and a single level of shared cache
.
In this diagram, what is L1 cache really split into?
Data cache (read and write)
Instruction cache (read only)
Draw a diagram of 4 cores with a shared memory and multiple shared caches
.
Draw a diagram of 4 cores with a shared memory, private L1 and L2 cache, and shared L3 cache
.
List the 3 cache inclusion schemes
- Inclusive
- Exclusive
- Non-inclusive non-exclusive (NINE)
Draw a diagram to show inclusive cache inclusion
.
Draw a diagram to show exclusive cache inclusion
.
Draw a diagram to show NINE cache inclusion
.
What are the advantages and disadvantages of inclusive cache inclusion?
+ Miss may not have to go all the way to memory
- Wasteful since data is duplicated at different cache levels (L1 data is also in L2, L3)
What are the advantages and disadvantages of exclusive cache inclusion?
+ More space in cache because no duplicate data
- More complicated - when we remove data from L1 it needs to be written to L2. This might kick data out of L2 etc. so effects will be propagated through cache hierarchy
What is a write through cache?
Each write is propagated through caches to memory
Creates alot of traffic, still need to propagate values to other cores
What is a write back cache?
Changes are written to memory after a batch of writes
Ideally only propagate values when necessary (ie. on reads by another core)
What kind of data do caches allow faster access to?
Data with temporal or spatial locality
Which type of cache do we prefer to use?
Write-back caches