Docsity

Directory Organization in Multiprocessor Systems, Slides of Parallel Computing and Programming

Partial preview of the text

Download Directory Organization in Multiprocessor Systems and more Slides Parallel Computing and Programming in PDF only on Docsity!

Lecture 11:

Multiprocessor 3: Directory Organization

Example Directory Protocol

Contd.

  • Write miss: block has a new owner. A message is sent to old

owner causing the cache to send the value of the block to the

directory from which it is sent to the requesting processor,

which becomes the new owner. Sharers is set to identity of new

owner, and state of block is made Exclusive.

Cache to Cache Transfer: Can occur with a remote read or write

miss. Idea: Transfer block directly from the cache with exclusive

copy to the requesting cache. Why go through directory?

Rather inform directory after the block is transferred => 3

transfers over the IN instead of 4.

Protocol Enhancements for Latency

• Forwarding messages: memory-based

protocols

L H R

1: req
2:reply
3:intervention
4a:revise
4b:response

L H R

1: req 2:intervention
4:reply 3:response

L H R

1: req 2:intervention
3b:response
3a:revise

( a) Strict request-reply ( a) Intervention forwarding

( a) Reply forwarding

Intervention is like a req,
but issued in reaction to
req. and sent to cache,
rather than memory.

Example

P1 P2 Bus Directory Memory step State Addr Value State Addr Value Action Proc. Addr Value Addr State {Procs} Value P1: Write 10 to A

P1: Read A P2: Read A

P2: Write 40 to A

P2: Write 20 to A

A1 and A2 map to the same cache block

Processor 1 Processor 2 Interconnect Directory Memory

Example

P1 P2 Bus Directory Memory step State Addr Value State Addr Value Action Proc. Addr Value Addr State {Procs} Value P1: Write 10 to A1 WrMs P1 A1 A1 Ex {P1} Excl. A1 10 DaRp P1 A1 0 P1: Read A1 Excl. A1 10 P2: Read A

P2: Write 40 to A

P2: Write 20 to A

A1 and A2 map to the same cache block

Processor 1 Processor 2 Interconnect Directory Memory

Example

P2: Write 20 to A

A1 and A2 map to the same cache block

P1 P2 Bus Directory Memory step State Addr Value State Addr Value Action Proc. Addr Value Addr State {Procs} Value P1: Write 10 to A1 WrMs P1 A1 A1 Ex {P1} Excl. A1 10 DaRp P1 A1 0 P1: Read A1 Excl. A1 10 P2: Read A1 Shar. A1 RdMs P2 A Shar. A1 10 Ftch P1 A1 10 10 Shar. A1 10 DaRp P2 A1 10 A1 Shar. {P1,P2} 10 10 10 P2: Write 40 to A2 10

Processor 1 Processor 2 Interconnect Directory Memory

A
Write Back
A

Example

P2: Write 20 to A

A1 and A2 map to the same cache block

P1 P2 Bus Directory Memory step State Addr Value State Addr Value Action Proc. Addr Value Addr State {Procs} Value P1: Write 10 to A1 WrMs P1 A1 A1 Ex {P1} Excl. A1 10 DaRp P1 A1 0 P1: Read A1 Excl. A1 10 P2: Read A1 Shar. A1 RdMs P2 A Shar. A1 10 Ftch P1 A1 10 10 Shar. A1 10 DaRp P2 A1 10 A1 Shar. {P1,P2} 10 Excl. A1 20 WrMs P2 A1 10 Inv. Inval. P1 A1 A1 Excl. {P2} 10 P2: Write 40 to A2 10

Processor 1 Processor 2 Interconnect Directory Memory

A1 A

Example

P2: Write 20 to A

A1 and A2 map to the same cache block

P1 P2 Bus Directory Memory step State Addr Value State Addr Value Action Proc. Addr Value Addr State {Procs} Value P1: Write 10 to A1 WrMs P1 A1 A1 Ex {P1} Excl. A1 10 DaRp P1 A1 0 P1: Read A1 Excl. A1 10 P2: Read A1 Shar. A1 RdMs P2 A Shar. A1 10 Ftch P1 A1 10 10 Shar. A1 10 DaRp P2 A1 10 A1 Shar. {P1,P2} 10 Excl. A1 20 WrMs P2 A1 10 Inv. Inval. P1 A1 A1 Excl. {P2} 10 P2: Write 40 to A2 WrMs P2 A2 A2 Excl. {P2} 0 WrBk P2 A1 20 A1 Unca. {} 20 Excl. A2 40 DaRp P2 A2 0 A2 Excl. {P2} 0

Processor 1 Processor 2 Interconnect Directory Memory

A1 A

P

M

Reducing Storage Overhead

• Optimizations for full bit vector

schemes

– increase cache block size (reduces storage

overhead proportionally)

– use multiprocessor nodes (bit per mp

node, not per processor)

– still scales as P*M, but reasonable for all

but very large machines

• 256-procs, 4 per cluster, 128B line: 6.25%

ovhd.

• Reducing “width”

– addressing the P term?

Storage Reductions

• Width observation:

– most blocks cached by only few nodes

– don’t have a bit per node, but entry

contains a few pointers to sharing nodes

– P=1024 => 10 bit ptrs, can use 100 pointers

and still save space

– sharing patterns indicate a few pointers

should suffice (five or so)

– need an overflow strategy when there are

more sharers

• Height observation: Docsity.com

Cache Invalidation Patterns

LU Inv alidation Patterns

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0. 0

10

20

30

40

50

60

70

80

90

100

0 1 2 3 4 5 6 7 8 to 1112 to 1516 to 1920 to 2324 to 2728 to 3132 to 3536 to 3940 to 4344 to 4748 to 5152 to 5556 to 5960 to 63 # of inv alidations

Ocean Inv alidation Patterns

0

3.04 (^) 0.49 0.34 (^) 0.03 0 0.03 0 0 0 0 0 0 0 0 0 0 0 0 0. 0

10

20

30

40

50

60

70

80

90

0 1 2 3 4 5 6 7 8 to 1112 to 1516 to 1920 to 2324 to 2728 to 3132 to 3536 to 3940 to 4344 to 4748 to 5152 to 5556 to 5960 to 63 # of inv alidations

Cache Invalidation Patterns

Barnes-Hut Inv alidation Patterns

5.33 2. 1.88 (^) 1.4 2.5^ 1.06 (^) 0.61 (^) 0.24 0.28 0.2 0.06 0.1 0.07 0 0 0 0 0. 0

5

10

15

20

25

30

35

40

45

50

0 1 2 3 4 5 6 7 8 to 1112 to 1516 to 1920 to 2324 to 2728 to 3132 to 3536 to 3940 to 4344 to 4748 to 5152 to 5556 to 5960 to 63 # of inv alidations

Radiosity Inv alidation Patterns

4.16 (^) 2.24 (^) 1.59 (^) 1.16 0.97 3.28 (^) 2.2 1.74 (^) 1.46 (^) 0.92 (^) 0.45 0.37 0.31 0.28 0.26 0.24 0.19 0.19 0. 0

10

20

30

40

50

60

0 1 2 3 4 5 6 7 8 to 1112 to 1516 to 1920 to 2324 to 2728 to 3132 to 3536 to 3940 to 4344 to 4748 to 5152 to 5556 to 5960 to 63

# of inv alidations Docsity.com

Overflow Schemes for Limited Pointers

  • Broadcast (Dir (^) iB): Directory size is I. If more copies are needed (Overflow), enable broadcast bit so that invalidation signal will be broadcast to all processors in case of a write - bad for widely-shared frequently read data
  • No-broadcast (DiriNB): Don’t allow more than I copies to be present at any time. If a new request arrives, invalidate one of the existing copies - on overflow, new sharer replaces one of the old ones - bad for widely read data
  • Coarse vector (Dir (^) iCV)
    • change representation to a coarse vector, 1 bit per k nodes
    • on a write, invalidate all nodes that a bit corresponds to

Ref: Chaiken, et al “Directory-Based Cache Coherence in Large-Scale Multiprocessors”, IEEE Computer, June 1990.

P 0 P 1 P 2 P (^3)

P 4 P 5 P 6 P (^7)

P 8 P 9 P 10 P 11

P 12 P 13 P 14 P (^15)

1

Over½ow bit 8-bit coarse vector

(a) Over½ow

P 0 P 1 P 2 P (^3)

P 4 P 5 P 6 P (^7)

P 8 P 9 P 10 P (^11)

P 12 P 13 P 14 P 15

0

Over½ow bit 2 Pointers

(a) No over½ow

Docsity.com

Overflow Schemes (contd.)

• Software (Dir

i

SW)

– trap to software, use any number of

pointers (no precision loss)

• MIT Alewife: 5 ptrs, plus one bit for local

node

– but extra cost of interrupt processing on

software

• processor overhead and occupancy

• latency

  • 40 to 425 cycles for remote read in Alewife
  • 84 cycles for 5 inval, 707 for 6.

• Dynamic pointers (Dir

i

DP) Docsity.com