csv 889: concurrent software verification subodh sharma indian institute of technology delhi relaxed...

15
CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Upload: elisabeth-thomas

Post on 18-Jan-2018

218 views

Category:

Documents


0 download

DESCRIPTION

TSO – Total Store Order Exhibited in x86 h/w w-r relaxation (to different variables) All writes are totally ordered

TRANSCRIPT

Page 1: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

CSV 889: Concurrent Software Verification

Subodh SharmaIndian Institute of Technology Delhi

Relaxed Memory Effects and its Verification

Page 2: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Why Relaxed Memory

• Higher Performance• How? – Speculative execution, buffering, caching, etc.

This leads to nonintuitive executionVerification becomes difficult

Page 3: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

TSO – Total Store Order

• Exhibited in x86 h/w• w-r relaxation (to different variables) • All writes are totally ordered

Page 4: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

PSO – Total Store Order

• w-r relaxation + w-w relaxation too – to different variables

• All writes to the same variable are totally ordered

Page 5: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Effects of RMM on Stateless Model Checking

• Explosion in the number of interleavings– Why?

New bugs!

T1() { int a; x = 1; a = y; print (“%d”, a);}

T2() { y=1; b=x; print(“%d”, b); }

TSO

Page 6: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Effects of RMM on Stateless Model Checking

• Explosion in the number of interleavings– Why?

New bugs!

T1() { x = 1; y = 1; }

T2() { if(y==1) if(x==0) ERROR(); }

PSO

Not reachable under TSO or SC!

Page 7: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

DPOR for TSO/PSO

• thread scheduling nondeterminism• store buffering nondeterminism

• Key ideas – buffer bounding for aggressive optimization – shadow threads to model buffered writes

Page 8: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Shadow Threads

Page 9: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Shadow Threads

Must HB order between buffered writes and flushes to the memory

BWs are omitted as they are thread local!

Page 10: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Shadow Threads for PSO

To model per-address store buffers in PSO – one shadow thread per var

Page 11: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Advantages

• No need to distinguish edges from scheduling and buffering nondeterminism!

Implies classical DPOR features are applicable!

Page 12: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Changes in DPOR Defs

• Enabled/Done/BT set: sets of pairs of

Page 13: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Changes in DPOR Defs

• Dependency Relation

Page 14: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Buffer Bounding

• Flushing of writes can be delayed for finitely many subsequent writes

Page 15: CSV 889: Concurrent Software Verification Subodh Sharma Indian Institute of Technology Delhi Relaxed Memory Effects and its Verification

Acknowledgements

DPOR for RMM by Zhang, Kusano, Wang: PLDI 2015