in place metainfo support in deucestm
play

In-Place Metainfo Support in DeuceSTM Ricardo J. Dias , - PowerPoint PPT Presentation

In-Place Metainfo Support in DeuceSTM Ricardo J. Dias , Tiago M. Vale and Joo M. Loureno CITI / Universidade Nova de Lisboa WTM12, Bern,


  1. In-­‑Place ¡Metainfo ¡Support ¡in ¡ DeuceSTM ¡ Ricardo ¡J. ¡Dias , ¡Tiago ¡M. ¡Vale ¡and ¡João ¡M. ¡Lourenço ¡ CITI ¡/ ¡Universidade ¡Nova ¡de ¡Lisboa ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 1 ¡

  2. MoEvaEon ¡ • Fair ¡comparison ¡of ¡different ¡STM ¡algorithms ¡ • Require ¡a ¡flexible ¡framework ¡to ¡support ¡ different ¡STM ¡implementaEons ¡ – MulE-­‑version, ¡lock-­‑based, ¡… ¡ – Same ¡transacEonal ¡interface ¡ – Same ¡benchmarking ¡applicaEons ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 2 ¡

  3. The ¡DeuceSTM ¡ J ¡ TransacEons ¡defined ¡by ¡a ¡single ¡Java ¡method ¡ • J annotaEon: ¡@Atomic ¡ J ¡ Well-­‑defined ¡API ¡for ¡implemenEng ¡STM ¡algorithms ¡ • J J ¡ Efficient ¡implementaEon ¡of ¡some ¡STM ¡algorithms, ¡ • J e.g., ¡TL2, ¡LSA, ¡… ¡ J ¡ Macro-­‑benchmarks ¡available ¡ • J L ¡ Does ¡not ¡allow ¡the ¡efficient ¡implementaEon ¡of ¡ • L other ¡STM ¡algorithms, ¡e.g., ¡mulE-­‑version ¡ ¡ L ¡ Fair ¡comparison ¡is ¡not ¡possible ¡ • L WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 3 ¡

  4. TransacEonal ¡InformaEon ¡ Tx ¡Desc. ¡ Thread-­‑local ¡ Clock ¡= ¡3 ¡ Memory ¡ Thread ¡1 ¡ Lock, ¡ 1 ¡ Data ¡ version ¡… ¡ Lock, ¡ Tx ¡Desc. ¡ 2 ¡ Data ¡ TxWrite ¡ version ¡… ¡ Clock ¡= ¡2 ¡ Metainfo ¡ Thread ¡2 ¡ Lock, ¡ Data ¡ 3 ¡ version ¡… ¡ Lock, ¡ 4 ¡ Data ¡ Tx ¡Desc. ¡ ¡ version ¡… ¡ d a e R Clock ¡= ¡3 ¡ x T … ¡ Thread ¡3 ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 4 ¡

  5. Out-­‑place: ¡N-­‑1 ¡ External ¡ Memory ¡ Mapping ¡Table ¡ • Efficient ¡implementaEon ¡ using ¡an ¡hash ¡funcEon ¡ 1 ¡ Lock ¡ Data ¡ • False ¡sharing ¡ ¡ 2 ¡ Data ¡ Lock ¡ • Algorithms: ¡ – TL2, ¡SwissTM, ¡LSA ¡ Data ¡ Lock ¡ 3 ¡ Data ¡ Lock ¡ 4 ¡ … ¡ … ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 5 ¡

  6. Out-­‑place: ¡1-­‑1 ¡ External ¡ Memory ¡ Mapping ¡Table ¡ • Hash ¡table ¡with ¡collision ¡list ¡ Version ¡ 1 ¡ Data ¡ • Bad ¡performance ¡ List ¡ • Algorithms: ¡ Version ¡ 2 ¡ Data ¡ List ¡ – MulE-­‑version ¡algorithms ¡ Version ¡ Data ¡ 3 ¡ List ¡ Version ¡ Data ¡ 4 ¡ List ¡ … ¡ … ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 6 ¡

  7. In-­‑place: ¡1-­‑1 ¡ Memory ¡ • Direct ¡access ¡to ¡metainfo ¡ Version ¡ 1 ¡ Data ¡ using ¡memory ¡reference ¡ List ¡ • Mostly ¡used ¡in ¡managed ¡ Version ¡ 2 ¡ Data ¡ runEmes ¡(OO ¡languages) ¡ List ¡ Add ¡support ¡for ¡In-­‑place ¡in ¡DeuceSTM ¡ • Algorithms: ¡ Version ¡ Data ¡ 3 ¡ List ¡ – TL2, ¡SwissTM, ¡LSA, ¡MulE-­‑ Version ¡ version ¡algorithms ¡ Data ¡ 4 ¡ List ¡ … ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 7 ¡

  8. Out-­‑place ¡in ¡DeuceSTM ¡ Object ¡ Field ¡ instance ¡ offset ¡ TransacEonal ¡Interface ¡ TxRead(obj, ¡field) ¡ TxWrite(obj, ¡field, ¡val) ¡ Table ¡Key ¡ Metainfo ¡table ¡ (obj 1 ,field) ¡ [metainfo 1 ] ¡ (obj 2 ,field) ¡ [metainfo 2 ] ¡ (obj 3 ,field) ¡ [metainfo 3 ] ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 8 ¡

  9. Out-­‑place ¡InstrumentaEon ¡ class class C { C { class C { class C { int int x; int int x; static static int int x_off x_off = = Offset (x); ); @Atomic foo() { x x = x+1; @Atomic foo() { } int int t = = TxRead(this this, , x_off x_off ); ); } ¡ TxWrite(this this, , x_off x_off , t+1); , t+1); } } ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 9 ¡

  10. Our ¡In-­‑place ¡Approach ¡ Object ¡A ¡ Object ¡A ¡ Object ¡B ¡ fields* ¡ field1 ¡ field1 ¡ methods()* ¡ fields* ¡ field1 m ¡ fields* ¡ methods()* ¡ methods()* ¡ Object ¡M ¡ [metainfo] ¡ TransacEonal ¡Interface ¡ TxRead(obj, ¡field) ¡ TxRead(metainfo) ¡ TxWrite(obj, ¡field, ¡val) ¡ TxWrite(metainfo, ¡val) ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 10 ¡

  11. Our ¡In-­‑place ¡Approach ¡ class class C { C { class class C { C { int int x; int int x; TxField TxField x_m x_m = = new TxField (); (); @Atomic foo() { x x = x+1; @Atomic foo() { } int int t = = TxRead(x_m x_m); ); } ¡ TxWrite(x_m x_m, t+1); , t+1); } } ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 11 ¡

  12. Metainfo ¡and ¡arrays ¡ New ¡array: ¡TxArrField[] ¡ [0] ¡ TxArrField ¡ array ¡ index ¡= ¡0 ¡ [metainfo] ¡ Original ¡array: ¡int[] ¡ [1] ¡ [0] ¡ 5 ¡ TxArrField ¡ array ¡ [1] ¡ index ¡= ¡1 ¡ 3 ¡ [metainfo] ¡ [2] ¡ [2] ¡ 8 ¡ TxArrField ¡ array ¡ index ¡= ¡2 ¡ [metainfo] ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 12 ¡

  13. Metainfo ¡and ¡arrays ¡ class class C { C { class C { class C { int int[] [] a = = new new int int[10]; [10]; TxArrInt[] a = new new TxArrInt[10]; { @Atomic foo() { int int[] [] t = = new new int int[10]; a[1] = a[2]+1; for for (int int i=0; i < 10; i++) { } a[i] = new new TxArrInt(i, t); } void void bar() { } a[2] = 3; TxField a_m = new new TxField(); } } ¡ @Atomic foo() { int int t = = TxRead(a[2]); TxWrite(a[1], t+1); } void void bar() { { a[0].array[3] = 3; } } ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 13 ¡

  14. Experimental ¡EvaluaEon ¡ Overhead ¡ • Benchmarking ¡algorithm: ¡TL2 ¡using ¡a ¡lock ¡ table ¡ • Base ¡case: ¡ – Using ¡out-­‑place ¡strategy ¡(original ¡DeuceSTM) ¡ • Comparing ¡case: ¡ – Using ¡in-­‑place ¡strategy ¡ • Metainfo ¡objects ¡are ¡created ¡for ¡each ¡field ¡ • We ¡use ¡the ¡metainfo ¡object ¡as ¡the ¡key ¡for ¡the ¡external ¡ lock ¡table ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 14 ¡

  15. Experimental ¡EvaluaEon ¡ Overhead ¡ Write-­‑Update: ¡0% ¡ Not ¡using ¡Arrays ¡ Using ¡Arrays ¡ No ¡arrays: ¡overhead ¡3% ¡ With ¡arrays: ¡overhead ¡20% ¡ IntSet RBTree, update=0% IntSet SkipList, update=0% 35 35 30 30 25 25 Overhead (%) Overhead (%) 20 20 15 15 10 10 5 5 0 0 1 2 4 8 16 24 32 40 1 2 4 8 16 24 32 40 Threads Threads Overhead ¡in ¡% ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 15 ¡

  16. Experimental ¡EvaluaEon ¡ Overhead ¡ Write-­‑Update: ¡10% ¡ Not ¡using ¡Arrays ¡ Using ¡Arrays ¡ No ¡arrays: ¡overhead ¡7% ¡ With ¡arrays: ¡overhead ¡25% ¡ IntSet RBTree, update=10% IntSet SkipList, update=10% 35 35 30 30 25 25 Overhead (%) Overhead (%) 20 20 15 15 10 10 5 5 0 0 1 2 4 8 16 24 32 40 1 2 4 8 16 24 32 40 Threads Threads Overhead ¡in ¡% ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 16 ¡

  17. Experimental ¡Results ¡ In-­‑place ¡vs. ¡Out-­‑place ¡for ¡MulE-­‑version ¡ • Two ¡implementaEons ¡of ¡JVSTM ¡in ¡DeuceSTM ¡ ¡ – Out-­‑place ¡strategy ¡ • Versions ¡kept ¡in ¡external ¡table ¡with ¡collision ¡list ¡ – In-­‑place ¡strategy ¡ • No ¡external ¡table ¡ • Versions ¡kept ¡in ¡meta-­‑info ¡field ¡ • How ¡much ¡faster ¡is ¡the ¡in-­‑place ¡ implementaEon? ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 17 ¡

  18. Experimental ¡EvaluaEon ¡ MulE-­‑version ¡ Write-­‑Update: ¡10% ¡ Not ¡using ¡Arrays ¡ Using ¡Arrays ¡ IntSet RBTree, update=10% IntSet SkipList, update=10% 35 35 Average ¡5 ¡Mmes ¡faster ¡ JVSTM-In JVSTM-In 30 30 Speedup (x faster) Speedup (x faster) 25 25 20 20 15 15 10 10 5 5 0 0 1 2 4 8 16 24 32 40 1 2 4 8 16 24 32 40 Threads Threads Speedup ¡in ¡X ¡faster ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 18 ¡

  19. Experimental ¡Results ¡ MulE-­‑version ¡ • JVSTM ¡algorithm ¡has ¡a ¡performance ¡ bopleneck ¡in ¡garbage ¡collecEon ¡of ¡unused ¡ versions ¡ – Is ¡it ¡limiEng ¡the ¡speedup ¡for ¡in-­‑place? ¡ • JVSTM-­‑noGC: ¡an ¡extension ¡of ¡JVSTM ¡where ¡ – Version ¡lists ¡are ¡fixed ¡sized ¡ – No ¡garbage ¡collecEon ¡of ¡unused ¡versions ¡ WTM’12, ¡Bern, ¡April ¡10, ¡2012 ¡ 19 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend