230 likes | 359 Views
An Empirical Comparison of Monitoring Algorithms for Access Anomaly Detection - Anne Dinning, Edith Shonberg -. [ DiSc90 ] May 5, 2012 Joong-Hoon Kim . OSLab. Contents. Introduction Definitions & Framework Access History Algorithm English-Hebrew Labeling Algorithm
E N D
An Empirical Comparison of Monitoring Algorithms for Access Anomaly Detection- Anne Dinning, Edith Shonberg - [ DiSc90 ] May 5, 2012 Joong-Hoon Kim. OSLab
Contents • Introduction • Definitions & Framework • Access History Algorithm • English-Hebrew Labeling Algorithm • Task Recycling Algorithm • Empirical results
Introduction - Access Anomaly • Access Anomaly • nondeterministic behavior, uncoordinated access to shared variables • occurs when either two concurrent threads both writes or one reads and one writes a shared memory without coordinating these accesses
Introduction - Access Anomaly (cont’d) Y = 1 Y = 1 doalli=1 to 2 X = Y +i endall Z = X + Y i = 1 i = 2 X = Y + 1 X = Y + 2 Z = X + Y Z = 3 or 4
Definitions & Framework • Definitions • doall-endall, coordination primitive • Block : an instruction sequence • executed by a single thread • not contains doall, endallor coordination operation • POEG - the concurrency relationship among blocks • DAG(Directed Acyclic Graph) • capture Lamport’s “Happens Before” relation • Impose partial order : transitive & not self-loop
Definitions & Framework (cont’d) • A Edge : a block, a coordination edge • coordination edge : connects vertices of two coordinating blocks. • A Vertex : a doall, endall or coordination operation • ancestor / descendant : whether or not there is a path • concurrent : iff neither is an ancestor of the other • Maximum concurrency = the maximum number of mutually concurrent blocks
Definitions & Framework (cont’d) b0 b2 b1 • concurrent : b3 ⇔ b4, b5, b2 b8 b3 b4 b5 • not concurrent : b3 ⇔ b0, b1 • (∵ ancestor) b9 b10 b11 b6 • not concurrent : b3 ⇔ b6, b13 • (∵ descendant) b7 b12 • maximum concurrency : 4 b13
Access History based algorithm • Access History • a label per a block • a set of labels of the blocks which have read and written variable • is examined to determine whether the currentevent conflicts with a previous one • The efficiency of an access anomaly algorithm • How quickly the test of concurrency can be made • How many entries are in the access history
Access History (cont’d) b0 b2 b1 b2(r) ⇒ b6(r) ⇒ b3(r) ⇒ b9(w) = X Read Write b3 b4 b5 b6 b7 b8 b2 b6 b3 b9 = X = X X = b9 b10 [ Access History of X ] b11
Access History (cont’d) • delete : a descendant of block accesses to the corresponding variable. • The size of an AH ≤ the maximum concurrency • Reader Set : contains 2 blocks only if concurrent • at most 1 writer in an AH • at least one anomaly is guaranteed to be reported
English-Hebrew Labeling Algorithm • EH Labeling • Tag : concurrency relationship among blocks • consists of a pair of labels <English,Hebrew> • English – a left-to-right preorder numbering of POEG • Hebrew – a right-to-left preorder numbering of POEG • Label : a string of numbers, lexicographically ordered • E-H Label assignments • children blocks : c1, c2, … , cm of a doall vertex with parent block p • Doall : E(tagci) ← E(tagp) | i • Coordination : E(tagc) ← E(tagp) | 1 • Endall : E(tagc) ← max(E(tagpi))
EH Algorithm – concurrency test 1,1 11,12 12,11 111,123 121,113 E(tagi)< E(tagj)and H(tagi) > H(tagj) 112,122 122,112 113,121 or 123,111 1211,1131 E(tagi) > E(tagj)and H(tagi) < H(tagj) 113,123 113,123 123,113 1131,1231 113,123 121,113 123,123
Task Recycling Algorithm • TR Labeling • a block : a unique task identifier(task no + version no) • More than 1 block can be assigned to the same task at different times • Version no : distinguish among different blocks • Is incremented whenever a block is assigned to a task • Parent Vector : to maintain concurrency information • only currently executing blocks need PV • the no of entries = the no of tasks • once a block terminates, its PV is discarded • new parent vector are formed from those vectors associated with parent blocks
TR Algorithm – parent vector • How to form new parent vectors • When blocks p1 … pmwith task ids t1v1 … tmvmcreate a new block c • ex.1, ex.2 for i = 1 to T do If ∃tj∈{t1 … tm}: i = tj thenparentc[i] ← vjelseparentc[i] ← max(parentp1[i], … , parentpm[i])endfor
TR Algorithm – concurrency test 11 Parentb[t] < v 12 21 22 51 61 13 31 41 23 14 24 15 16
TR Algorithm – concurrency test • Concurrency determination • a block b is concurrent with a block with task Id tviffParentb[t] < v • Concurrent : block 13⇔ block 21 13 – [ 2, 0, 0, 0, 0, 0 ] < 1 • Not concurrent : block 15⇔ block 21 15 – [ 4, 2, 1, 1, 0, 0 ] > 1 • A constant cost(an array access)
Empirical Results • Concurrency Structure • Triso – coarse granularity parallelism, a single doall operation which create 8 parallel threads • Simple – medium granularity parallelism, 10 doall operations that each create 124 parallel threads, and 130 operations that create from 10 to 30 threads • Finite – fine granularity parallelism, 60 doall operations that each create 1000 parallel threads; 50 operations that create 250 threads and 200 operations that create between 2 and 32 threads • Polymer – fine granularity parallelism, one level of nested doall operations, 40 nested doall operations, 40 nested doall operations, 20 doall operations ~
Reader Set Sizes • The size of reader sets tends to be very small • There appears to be little correlation between the average reader set size and the degree of parallelism of the p/g
Space Requirements (in Kbytes) • TR’s space < EH Labeling’s it (for maintaining concurrency information) ♣ : Estimated value
ex.1) in the case of 15 14 – [ 3, 0, 1, 1, 0, 0 ] 22 – [ 1, 1, 0, 0, 0, 0 ] 15 – [ 4, 2, 1, 1, 0, 0 ] i = 1 i = 2 i = 3 i = 4 i = 5 i = 6
ex.2) in the case of 24 23–[ 4, 2, 1, 1, 0, 0 ] 51–[ 1, 1, 0, 0, 0, 0 ] 61–[ 1, 1, 0, 0, 0, 0 ] 24 – [ 4, 3, 1, 1, 1, 1 ] i = 1 i = 2 i = 3 i = 4 i = 5 i = 6