Top Banner
NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures Phuong H. Ha (Univ. of Tromsø, Norway) Philippas Tsigas (Chalmers Univ., Sweden) Otto J. Anshus (Univ. of Tromsø, Norway) Presentation at OPODIS ’09 December 15-18, 2009, Nimes, France
21

NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Jan 01, 2016

Download

Documents

darius-maynard

NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures. Phuong H. Ha (Univ. of Tromsø, Norway) Philippas Tsigas (Chalmers Univ., Sweden) Otto J. Anshus (Univ. of Tromsø, Norway). Presentation at OPODIS ’09 December 15-18, 2009, Nimes, France. Problem. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive forManycore Architectures

Phuong H. Ha (Univ. of Tromsø, Norway) Philippas Tsigas (Chalmers Univ., Sweden)Otto J. Anshus (Univ. of Tromsø, Norway)

Presentation at OPODIS ’09

December 15-18, 2009, Nimes, France

Page 2: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Problem Manycores require scalable strong synchronization

primitives. Conventional strong primitives do not scale well enough

for manycores [UCB Landscape]. Contention on a synchronization variable increases with

the number of processing cores.

OPODIS '09, Nimes, France

2 cores 16 cores 1000 cores

Page 3: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Desired features New synch. primitives for manycores should

be: Scalable

1000s of cores

Universal powerful enough to support any kind of synchronization

(like CAS, LL/SC)

Feasible able to implement in hardware

Easy-to-use

OPODIS '09, Nimes, France

Page 4: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Our main contributions

A novel synch. primitve with all these features

OPODIS '09, Nimes, France

• Non-blocking Full/Empty Bit (NB-FEB)• NBFEB-STM: a non-blocking STM

Page 5: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Road-map

NB-FEB Feasible Universal Scalable Easy-to-use

NBFEB-STM: a non-blocking STM

OPODIS '09, Nimes, France

Page 6: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Feasibility Key idea: slight modifications of a widely deployed primitive

A variant of the original FEB that always returns a value instead of waiting for a conditional flag

OPODIS '09, Nimes, France

Test-Flag-and-SetTFAS( x, v) { (o, flago) (x, flagx); if flagx = false then (x, flagx) (v, true); end if return (o, flago);}

Store-And-ClearSAC( x, v) { (o, flago) (x, flagx); (x, flagx) (v, false); return (o, flago);}Store-And-SetSAS( x, v) { (o, flago) (x, flagx); (x, flagx) (v, true); return (o, flago);}

LoadLoad( x) { return (x, flagx);}

Original FEB: Store-if-Clear-and-SetSICAS(x,v) { Wait for flagx to be false; (x, flagx) (v, true);}

Page 7: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Universality Key idea: write-once objects with 3+ states

TFAS Wait-free consensus, n

OPODIS '09, Nimes, France

Decision (, false);

TFAS_Consensus( proposal) { (first, ) TFAS(Decision, proposal); if first = then return proposal; else return first;}

Page 8: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Scalability Key idea: Combinability

eliminates contention & reduce load Ex: TFAS

OPODIS '09, Nimes, France

x=

TFAS(x,1)TFAS(x,2)

TFAS(x,3)TFAS(x,4)

TFAS(x,1) TFAS(x,3)

TFAS(x,1)

x=1

1 1 1

1

TFAS( var x, value v) atomically { (o, flago) (x, flagx); if flagx = false then (x, flagx) (v, true); end if return (o, flago);}

Note: CAS or LL/SC is not combinable

Page 9: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

NB-FEB combining logic

OPODIS '09, Nimes, France

(x, [v1]) Successive primitive with parameter (x, [v2])

Load SAC SAS TFAS

Load Load SAC(v2) SAS(v2) TFAS(v2)

SAC SAC(v1) SAC(v2) SAS(v2) SAS(v2)

SAS SAS(v1) SAC(v2) SAS(v2) SAS(v1)

TFAS TFAS(v1) SAC(v2) SAS(v2) TFAS(v1)

Page 10: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Easy-to-use

Key idea: abstractions for productivity-layer programmers Non-blocking software transactional memory NBFEB-STM

OPODIS '09, Nimes, France

Page 11: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Road-map

NB-FEB Feasible Universal Scalable Easy-to-use

NBFEB-STM: a non-blocking STM

OPODIS '09, Nimes, France

Page 12: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

NBFEB-STM

Models Objects are accessed within transactions No nested transactions Garbage collected programming languages (e.g.

Java)

Features Obstruction-free STM Eliminate conventional synch. hot spots in STMs Optimal space complexity (N)

OPODIS '09, Nimes, France

Page 13: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Challenge 1: TFAS-SAC interleavingCAS-based STMs NBFEB-STM

Need SAC to clear pointer’s flag

Overlapping TFAS1 & TFAS2 both may succeed due to SAC’s interference.

violate TMObj’s semantics

OPODIS '09, Nimes, France

TMObj

Old NewTM0

Old NewTM1

Copy

CAS1

Old NewTM2

CopyCAS2

locator

Page 14: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Key idea 1 Keep a linked list of locators

write-once pointer next

OPODIS '09, Nimes, France

locator

Old NewTM0

Old NewTM1

Old NewTM2

eliminate SAC interference

TFAS

TFAS

Page 15: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Challenge 2: Space complexity

OPODIS '09, Nimes, France

CAS-based STMs NBFEB-STM

TMObj

Old NewTM0

Old NewTM1

Old NewTM2

CAS2

locator locator

Old NewTM0

Old NewTM1

Old NewTM2

Page 16: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Key idea 2 Only the head is needed for further accesses break the list of obsolete locators

OPODIS '09, Nimes, France

locator

Old NewTM0

Old NewTM1

Old NewTM2

pi

pi

SAC

Optimal space complexity (N)

Page 17: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Challenge 3: Find the head

OPODIS '09, Nimes, France

locator

Old NewTM0

Old NewTM1

Old NewTM2

pi

pi

HeadX

Page 18: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Key idea 3 No nested transactions one active locator / thread

OPODIS '09, Nimes, France

i

0

1

……

N

TMObj locator

Old NewTM0

Old NewTM1

Old NewTM2

pi

pi

SAC

Page 19: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Correctness

NBFEB-STM fulfills the essential aspects of TM [Guerraoui, PPoPP ’08] Instantaneous commit Precluding inconsistent views Preserving real-time order

OPODIS '09, Nimes, France

Page 20: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

Conclusions

Introduce a novel non-blocking full/empty bit primitive (NB-FEB) Scalable, universal, feasible and easy-to-use

Provide an abstraction, NBFEB-STM, built on top of the primitive.

OPODIS '09, Nimes, France

Page 21: NB-FEB: A Universal Scalable Easy-to-Use Synchronization Primitive for Manycore Architectures

OPODIS '09, Nimes, France

Thanks for your attention!