22
Majid saleem 11-ntu-1232 BSCS 6 th (A) Submitted To: Sir Nasir Mahmood Submission Date: 05-07-2014 National Textile university Faisalabad

Cache coherence problem and its solutions

Embed Size (px)

DESCRIPTION

defination of cache coherence ,problem and its software and hardware base solutions

Citation preview

Page 1: Cache coherence problem and its solutions

Majid saleem

11-ntu-1232

BSCS 6th(A)

Submitted To: Sir Nasir Mahmood

Submission Date: 05-07-2014

National Textile university Faisalabad

Page 2: Cache coherence problem and its solutions

CACHE COHERENCE:

………………………

Page 3: Cache coherence problem and its solutions

DEFINATION:

Cache coherence is the discipline that ensures that changes in the values of shared operands are propagated throughout the system in a timely fashion.

Page 4: Cache coherence problem and its solutions

EXPLANATION:

shared memory multiprocessor

separate cache memory for each processor

possible to have many copies of any one instruction operand

one copy in the main memory and one in each cache memory.

When one copy of an operand is changed, the other copies of the operand must be changed also.

Page 5: Cache coherence problem and its solutions

THERE ARE THREE DISTINCT LEVELS OF CACHE COHERENCE: every write operation appears to occur instantaneously

all processors see exactly the same sequence of changes of values for each separate operand

different processors may see an operation and assume different sequences of values; this is considered to be a noncoherent behavior

Page 6: Cache coherence problem and its solutions

CACHE COHERENCY PROBLEM •

update from a writing processor is not known to other processors

Page 7: Cache coherence problem and its solutions

 TWO TYPES OF SOLUTIONS:

Software-based

Hardware base

Page 8: Cache coherence problem and its solutions

SOFTWARE-BASED

Compiler based or with run-time system support.

With or without hardware assist.

Tough problem because perfect information is needed in the presence of memory aliasing and explicit parallelism.

Page 9: Cache coherence problem and its solutions

TWO TYPES OF HARDWARE_BASE SOLUTION:

Snooping

Directory_Based

Page 10: Cache coherence problem and its solutions

SNOOPING: used with low-end MPs

few processors

centralized memory

bus-based

distributed implementation: responsibility for maintaining coherence lies with each cache

Page 11: Cache coherence problem and its solutions

LOW END MP’S

Page 12: Cache coherence problem and its solutions

SNOOPING IMPLEMENTATION

A distributed coherency protocol

coherency state associated with each cache block

each snoop maintains coherency for its own cache

Page 13: Cache coherence problem and its solutions

CONTINUE…….HOW THE BUS IS USED?

broadcast medium

entire coherency operation is atomic wrt other processors

keep-the-bus protocol: master holds the bus until the entire operation has completed

Page 14: Cache coherence problem and its solutions

CONTINUE……. SPLIT-TRANSACTION BUSES

request & response are different phases

state value that indicates that an operation is in progress

do not initiate another operation for a cache block that has one in progress

Page 15: Cache coherence problem and its solutions

BUS IN SNOOPING

Page 16: Cache coherence problem and its solutions

AN EXAMPLE SNOOPING PROTOCOL: INVALIDATION-BASED COHERENCY PROTOCOL EACH CACHE BLOCK IS IN ONE OF THREE STATESshared:

clean in all caches & up-to-date in memory

block can be read by any processor

exclusive:

dirty in exactly one cache

only that processor can write to it (it’s the owner of the block)

invalid:

block contains no valid data

Page 17: Cache coherence problem and its solutions

DIRECTORY-BASED

• used with higher-end MPs

more processors

distributed memory

multi-path interconnect

centralized for each address: responsibility for maintaining coherence lies with the directory for each address

Page 18: Cache coherence problem and its solutions

DIRECTORY IMPLEMENTATION

Distributed memory machine

processor-memory pairs are connected via a multi-path interconnection network

point-to-point communication

snooping with broadcasting is wasteful of the parallel communication capability

each processor (or cluster of processors) has its own memory

a processor has fast access to its local memory & slower access to “remote” memory located at other processors

NUMA (non-uniform memory access) machines

Page 19: Cache coherence problem and its solutions

INTERCONNECTION NETWORK

Page 20: Cache coherence problem and its solutions

DIRECTORY IMPLEMENTATION• directory tracks state of cache blocks

• shared:

at least 1 processor has the data cached & memory is up- to-date

block can be read by any processor

• exclusive:

1 processor (the owner) has the data cached & memory is stale

only that processor can write to it

• invalid:

no processor has the data cached & memory is up-to-date ctory tracks state of cache blocks

Page 21: Cache coherence problem and its solutions

CONTINUE…..

Directory blocks play different roles during a memory operation. home node:

the memory location of the requested data

local node:

where the memory request initiated

remote node:

an alternate location for the data if this processor has requested & cached it

Page 22: Cache coherence problem and its solutions

ANY QUESTION.????Thank you…………………………………………….