SEER
Nuno Diegues, Paolo Romano and Stoyan Garbatov 27th Symposium on Parallel Architectures and Algorithms
SEER PROBABILISTIC SCHEDULING FOR COMMODITY HARDWARE TRANSACTIONAL - - PowerPoint PPT Presentation
27 th Symposium on Parallel Architectures and Algorithms SEER PROBABILISTIC SCHEDULING FOR COMMODITY HARDWARE TRANSACTIONAL MEMORY Nuno Diegues , Paolo Romano and Stoyan Garbatov 2 Seer: Scheduling for Commodity HTM SPAA 2015 The multi-core
Nuno Diegues, Paolo Romano and Stoyan Garbatov 27th Symposium on Parallel Architectures and Algorithms
Seer: Scheduling for Commodity HTM SPAA 2015
2
Multi-cores are now ubiquitous
Shared Memory
CPU 1 CPU 2 CPU 3 CPU 4
Concurrent programming is complex
Hard to get right:
Classic approach: Locking
atomic { withdraw(acc1,val); deposit(acc2,val); }
Transactional Memory abstraction Programmer identifies atomic blocks Runtime implements synchronization
Transactional Memory System
Seer: Scheduling for Commodity HTM SPAA 2015
3
y = x x++
Seer: Scheduling for Commodity HTM SPAA 2015
4
Seer: Scheduling for Commodity HTM SPAA 2015
5
Avoid running T1 and T2 concurrently How to find the root cause for the data conflict?
xbegin widthdraw(acc1,val) deposit(acc2,val) xend
Seer: Scheduling for Commodity HTM SPAA 2015
6
Transactions may abort:
same memory locations
Transactions restart
Seer: Scheduling for Commodity HTM SPAA 2015
7
No progress guarantees:
…due to a number of reasons:
Seer: Scheduling for Commodity HTM SPAA 2015
8
Seer: Scheduling for Commodity HTM SPAA 2015
9
Scheduler
Support for HTM? Support for Imprecise Information? Schedules Transactions in a Fine-Grained Fashion?
ATS [SPAA08] Yes Yes No CAR-STM [PODC08] No No Yes Shrink [PODC09] No No Yes ProPS [Euro-Par14] No No Yes SER [PPoPP10] No No Yes TxLinux [SOSP07] Yes No Yes SOA [HiPEAC09/10] Yes No Yes Seer Yes Yes Yes
Seer: Scheduling for Commodity HTM SPAA 2015
10
Seer: Scheduling for Commodity HTM SPAA 2015
11
Transaction = source code transaction active transactions
Seer: Scheduling for Commodity HTM SPAA 2015
12
Seer: Scheduling for Commodity HTM SPAA 2015
13
For each pair of transactions (x,y) acquire lock of each other if: Are abort events of x common enough with y running concurrently? Is y one of the main causes for x to abort? Hill climbing based adaptive loop for optimal Threshold search.
Seer: Scheduling for Commodity HTM SPAA 2015
14
Only one thread (re-)calculates the locking scheme:
Seer: Scheduling for Commodity HTM SPAA 2015
15
Intel Haswell 4 cores (8 hyper-threads)
Seer: Scheduling for Commodity HTM SPAA 2015
16
Threads Threads
Geometric Mean Speedup in STAMP 50%
Speedup Speedup
Genome Intruder
Seer: Scheduling for Commodity HTM SPAA 2015
17
Geometric Mean over STAMP w/ 8 threads Fine-grained locks
Seer: Scheduling for Commodity HTM SPAA 2015
18
Baseline: Seer with all mechanisms enabled (i.e., their overhead) but without any lock acquisitions.
HTM lock acquisition: Small improvement --- benchmark dependent the more locks, the better
Transaction locks: Detect conflicts inherent to benchmarks Core locks: Only relevant for >4t (hyper-threading)
Threshold tuning for probabilities Consistent/small improvement
Seer: Scheduling for Commodity HTM SPAA 2015
19
First scheduler tailored for Commodity HTMs:
Seer: Scheduling for Commodity HTM SPAA 2015
20
Seer: Scheduling for Commodity HTM SPAA 2015
21
Seer: Scheduling for Commodity HTM SPAA 2015
22
start: int status = htm_begin code: application logic htm_end // fast-path
Seer: Scheduling for Commodity HTM SPAA 2015
23
start: int status = htm_begin if (status == ok) // != ok when aborted if (fallback-in-use()) htm_abort // fall-back in use else goto code // fast-path ?? code: application logic if (inFastPath) htm_end // fast-path else ??
Seer: Scheduling for Commodity HTM SPAA 2015
24
start: int status = htm_begin if (status == ok) // != ok when aborted if (fallback-in-use()) htm_abort // fall-back in use else goto code // fast-path if (shouldRetry()) // retry policy goto start else use-fallback() // use fall-back code: application logic if (inFastPath) htm_end // fast-path else quit-fallback() // fall-back
Seer: Scheduling for Commodity HTM SPAA 2015
25
start: int status = htm_begin if (status == ok) // != ok when aborted if (isTaken(lock)) htm_abort // fall-back in use else goto code // fast-path if (shouldRetry()) // retry policy: e.g., limit retries to 10 goto start else acquire(lock) // use fall-back code: application logic if (inFastPath) // fast-path htm_end else // fall-back release(lock) Still simple enough.