Black-box Concurrent Data Structures for NUMA Architectures Irina - - PowerPoint PPT Presentation

black box concurrent data structures for numa
SMART_READER_LITE
LIVE PREVIEW

Black-box Concurrent Data Structures for NUMA Architectures Irina - - PowerPoint PPT Presentation

Black-box Concurrent Data Structures for NUMA Architectures Irina Calciu (VRG) Siddhartha Sen (MSR) Mahesh Balakrishnan (Yale) Marcos K. Aguilera (VRG) Concurrent Data Structures (CDS) Used everywhere: kernel, libraries, applications Issues:


slide-1
SLIDE 1

Black-box Concurrent Data Structures for NUMA Architectures

Irina Calciu (VRG) Siddhartha Sen (MSR) Mahesh Balakrishnan (Yale) Marcos K. Aguilera (VRG)

slide-2
SLIDE 2

Concurrent Data Structures (CDS)

Issues:

  • Difficult to design and

implement

  • Complex and rigid
  • Assume uniform memory

2

Used everywhere: kernel, libraries, applications

slide-3
SLIDE 3

Non-Uniform Memory Access (NUMA)

Cache Cache Cache Cache

3

slide-4
SLIDE 4

Goals

  • Design efficient NUMA-aware CDS
  • Black-box method: works for any

data structure

  • Application level

4

slide-5
SLIDE 5

Sequential data structure

App Thread 1 App Thread 2 App Thread 3 App Thread 4

  • p (e.g. “insert(X)”)

resp (e.g. “OK”)

  • p

resp

Transform sequential DS to NUMA-aware CDS

5

NUMA-aware concurrent data structure

App Thread 1 NUMA Node 1 NUMA Node 2 e.g. insert(A), remove(B), lookup(C)

slide-6
SLIDE 6

Sequential data structure

API

6

NUMA-aware concurrent data structure

N.Execute(op, args) -> Result N.IsReadOnly(op) -> Boolean

S.ExecuteSeq(op, args) -> Result

S N

slide-7
SLIDE 7

7

Our Method: Node Replication (NR)

NU NUMA ¡ ¡No Node ¡ ¡1

Local ¡Replica

NU NUMA ¡ ¡No Node ¡ ¡2

Local ¡Replica

Sequential data structure Synchronization between nodes Synchronization within a node Synchronization within a node

slide-8
SLIDE 8

8

Synchronizing Replicas (Cross-node)

NU NUMA ¡ ¡No Node ¡ ¡1

Local ¡Replica

NU NUMA ¡ ¡No Node ¡ ¡2

Local ¡Replica

Synchronization between nodes?

Shared ¡Log

slide-9
SLIDE 9

9

NU NUMA ¡ ¡No Node ¡ ¡1

Local ¡Replica Local ¡Tail

NU NUMA ¡ ¡No Node ¡ ¡2

Local ¡Replica Local ¡Tail

Shared ¡Log

LogTail

Synchronizing Replicas (Cross-node)

A B C A B C D E N insert ¡A insert ¡B insert ¡C insert ¡D insert ¡E insert ¡N remove ¡Z

slide-10
SLIDE 10

10

Synchronizing Each Replica (Intra-node)

NU NUMA ¡ ¡No Node ¡ ¡1

Local ¡Replica

NU NUMA ¡ ¡No Node ¡ ¡2

Local ¡Replica

Consistency

  • f replicas?

Access to replica? Access to replica?

Flat Combining Flat Combining

Shared ¡Log

slide-11
SLIDE 11

11

Empty ¡ ¡ ¡ Empty ¡ ¡ ¡ Empty ¡ ¡ ¡ Empty ¡ ¡ ¡ NU NUMA ¡ ¡No Node

Local ¡Replica Local ¡Tail

Access to Replica

Thread Thread Thread Thread

Flat ¡Combining: ¡[Hendler et ¡al., ¡2010]

Update ¡req Read ¡req Update ¡req Update ¡req

slide-12
SLIDE 12

12

Empty ¡ ¡ ¡ Empty ¡ ¡ ¡ Empty ¡ ¡ ¡ Empty ¡ ¡ ¡ NU NUMA ¡ ¡No Node

Local ¡Replica Local ¡Tail

Access to Replica

Thread Thread Thread Thread

Flat ¡Combining: ¡[Hendler et ¡al., ¡2010]

Update ¡req Read ¡req Update ¡req Read ¡req

R R

slide-13
SLIDE 13

13

Putting It All Together

Shared ¡Log

LogTail

NU NUMA ¡ ¡No Node

Local ¡Replica Local ¡Tail

Thread Thread Thread Thread

LogTail

slide-14
SLIDE 14

14

Algorithm Summary: Replication, Log, Combining

NU NUMA ¡ ¡No Node ¡ ¡1

Local ¡Replica

NU NUMA ¡ ¡No Node ¡ ¡2

Local ¡Replica

Consistency

  • f replicas?

Access to replica? Access to replica?

Flat Combining Flat Combining

Shared ¡Log

slide-15
SLIDE 15

15

4 NUMA nodes 14 cores/node + hyperthreading (total 112 hardware threads)

Server:

slide-16
SLIDE 16

16

20 40 60 1 28 56 84 110

  • ps/us

# threads

Skiplist Priority Queue – 10% Updates

(FC+) FC + RWL (RWL) Readers-Writer Lock (SL) Spinlock (FC) Flat Combining

X

(NR) Node Replication

X

(LF) Lock-free

slide-17
SLIDE 17

17

2 4 6 1 28 56 84 110

  • ps/us

# threads

Using Replication in REDIS: 10% Updates

(NR) Node Replication (FC+) FC + RWL (RWL) Readers-Writer Lock (FC) Flat Combining (SL) Spinlock

X

X

slide-18
SLIDE 18

Rationale

  • Trade memory + computation for less communication
  • Compact representation of operations
  • Limited cross-node synchronization and contention
  • Enable parallelism
  • Combiners across nodes
  • Readers within a node
  • Readers and the combiner on the same node
  • Leverage batching and reordering

18

slide-19
SLIDE 19

Conclusion: NodeReplication Works Well

  • Black-box: works for any data structure
  • Good for small and medium size CDS
  • Beneficial for contended CDS

19

slide-20
SLIDE 20

Thank you!

https://research.vmware.com/ icalciu@vmware.com