A Novel Home Migration Protocol in Homebased DSM
A Novel Home Migration Protocol in Home-based DSM W. J. Fang C. L. Wang W. Z. Zhu F. C. M. Lau System Research Group Department of Computer Science The University of Hong Kong wjfang@csis. hku. hk
Outline n Background n Problem Statement n Our Approach n Performance Evaluation n Conclusion 5/22/2021 wjfang@csis. hku. hk 2
Distributed Java Virtual Machine (DJVM) n A distributed Java Virtual Machine (DJVM) consists of a group of extended JVMs running on a distributed environment to support true parallel execution of a multithreaded Java application. import java. util. *; class worker extends Thread{ private long n; public worker(long N){ n=N; } public void run(){ long sum=0; for(long i=0; i<n; i++) sum+=i; System. out. println(“N=“+n+” Sum="+sum); } } public class test { static final int N=100; public static void main(String args[]){ worker [] w= new worker[N]; Random r = new Random(); for (int i=0; i<N; i++) w[i] = new worker(r. next. Long()); for (int i=0; i<N; i++) w[i]. start(); try{ for (int i=0; i<N; i++) w[i]. join(); } catch (Exception e){}} } (Single System Image) n A DJVM provides all the JVM services, that are compliant with the Java language specification. Global Object Space DJVM n Presents a Single System Image (SSI) of clusters to Java programs – an illusion that the program is running on a single machine, yet more powerful. 5/22/2021 Exec Thread JVM JVM Class JVM Java thread wjfang@csis. hku. hk HKU JESSICA 2 project: http: //www. srg. cs. hku. hk/ 3
Global Object Space n Virtualizes a single object heap spanning on the whole cluster. n A DSM service in the distributed JVM. n Java Memory Model: Resembles lazy release consistency. 5/22/2021 T 2 Before lock: flush cache Before unlock: write back wjfang@csis. hku. hk Access fault 4
LRC - Homeless Multiple-Writer Protocol n False Sharing – Two processes simultaneously write on the different parts of the same shared object. – Ping-pong effect if usingle-writer protocol. n Twin and Diff – Twin: the copy before writes. – Diff: the difference between the current copy and the twin. – Detect and batch the writes ever performed. n Homeless – The diff is saved and managed at each process. 5/22/2021 wjfang@csis. hku. hk 5
Drawbacks of Homeless Protocol n Communication overhead – Fetch diff from each previous writer. n Redundant operations – Fetch and apply diffs at each faulting node. n Memory consumption of twin and diff – Requires a global garbage collection. n Not scalable! 5/22/2021 wjfang@csis. hku. hk 6
LRC - Home-based Protocol n Each shared object has a home to which all writes (diffs) are propagated and from which all copies are derived. n Demonstrated to be more scalable than the homeless protocol. – Less communication, lower diff overhead, less memory consumption. n Access asymmetry – The access overhead at the home node is more lightweight than that at non-home nodes. 5/22/2021 wjfang@csis. hku. hk 7
Outline n Background n Problem Statement n Our Approach n Performance Evaluation n Conclusion 5/22/2021 wjfang@csis. hku. hk 8
Home Assignment Problem A home-based multiple-writer protocol implementing LRC P 0 (Home) Lock Write(X) P 1 (Home of X) Fault-in Home Migration Create twin Create diff Diff propagation Access symmetry Unlock Apply → Home assignment problem diff → Find the optimal home 5/22/2021 wjfang@csis. hku. hk 9
Related Work n Jia – Barrier manager detects single-writer pattern between two barriers. n JUMP – The process requiring the page may become the new home. – Blind to access pattern. n Jackal’s Lazy Flushing – Home is fixed. – A process may become the exclusive owner. – Blind to access pattern. n Some homeless DSMs (ADSM, Adaptive Tread. Marks) can switch between single-writer protocol and multiple-writer protocol. 5/22/2021 wjfang@csis. hku. hk 10
Home Migration n A must in home-based protocols. n Adapts to memory access pattern. – Targets at the single-writer pattern. – Home migration makes little difference in the multiple-writer situation as long as the home node is one of the writers. n Negative effect – Home migration notices n We need a timely and precise home migration protocol. 5/22/2021 wjfang@csis. hku. hk 11
Outline n Background n Problem Statement n Our Approach n Performance Evaluation n Conclusion 5/22/2021 wjfang@csis. hku. hk 12
Sensitivity of Home Migration Protocol P 0 P 1 (Home) remote read (fault-in) remote write (diff) ! Migrate home The less sensitive the protocol is 5/22/2021 wjfang@csis. hku. hk 13
Robustness of Home Migration Protocol remote read remote write Home HM notice P 0 P 1 Home A home P 2 migration protocol P 3 should be robust enough to prevent unnecessary home migrations. 5/22/2021 wjfang@csis. hku. hk 14
Sensitivity vs. Robustness n At a first glance – Sensitivity , robustness , and vice versa. – Can we achieve both sensitivity and robustness? n Single-writer pattern – Lasting single-writer pattern – Transient single-writer pattern n A good home migration protocol should demonstrate – sensitivity to the lasting single-writer pattern – robustness against the transient single-writer pattern v home migration is prohibited. 5/22/2021 wjfang@csis. hku. hk 15
Our Previous Work n A distributed JVM with GOS support n A home-based, object-based, multiple-writer protocol n Runtime detection of distributed-shared object n Adaptive optimizations – Object home migration (fixed threshold) – Synchronized method migration – Connectivity-based object pushing Weijian Fang, Cho-Li Wang and Francis C. M. Lau, ``On the Design of Global Object Space for Efficient Multi-threading Java Computing on Clusters’’, Parallel Computing Journal, Vol. 29, pp. 1563 -1587, November-December 2003. 5/22/2021 wjfang@csis. hku. hk 16
An Adaptive Threshold HM Protocol n An adaptive per-object home migration threshold. – decreases with increased likelihood that a particular object exhibits a lasting single-writer pattern. – A lower threshold more likely a lasting singlewriter patter quicker home migration. – A higher threshold less likely a lasting singlewriter patter (probably a transient single-writer pattern) more conservative home migration – Continuously adjusted at runtime according to the feedback of previous home migration decisions for each object. 5/22/2021 wjfang@csis. hku. hk 17
Runtime Feedback n Consecutive remote writes – Issued from the same remote node and not interleaved with the writes from either the home node or other remote nodes. – To detect single-writer pattern. n Exclusive home writes – There is no remote write between an exclusive home write and an earlier home write. – Positive feedback of previous home migrations. n Redirected object requests – Home migration notices. – Negative feedback of previous home migrations. n Home access coefficient – The overhead ratio of one eliminated pair of object fault-in and diff propagation to one home migration notice. 5/22/2021 wjfang@csis. hku. hk 18
Formalization n Ci : the number of consecutive remote writes since n n n 5/22/2021 the (i - 1)th home migration. Ti : the value of the adaptive home migration threshold since the (i - 1)th home migration. Tinit : the initial threshold, which is equal to 1. Ri : the number of redirected object requests since the (i - 1)th home migration. Ei : the number of exclusive home writes since the (i 1)th home migration. : the home access coefficient. : the feedback coefficient. It is set to 1. wjfang@csis. hku. hk 19
Formalization (contd. ) Home migration is taken if Ci = T i where Ti = max{(Ti-1 + (Ri - Ei)), Tinit} where T 0 = Tinit = 1 5/22/2021 wjfang@csis. hku. hk 20
Outline n Background n Problem Statement n Our Approach n Performance Evaluation n Conclusion 5/22/2021 wjfang@csis. hku. hk 21
Effects of Home Migration 5/22/2021 wjfang@csis. hku. hk 22
Adaptive Threshold vs. Fixed Threshold 5/22/2021 wjfang@csis. hku. hk 23
Sensitivity and Robustness Analysis 5/22/2021 wjfang@csis. hku. hk 24
Contributions n This is the first home migration protocol taking home migration notice overhead into account. n Our protocol is both sensitive to the lasting singlewriter pattern and robust against the transient singlewriter pattern. n We formulate the protocol. – The protocol uses a per-object adaptive migration threshold, which decreases with increased likelihood that the object presents the lasting single-writer pattern. – The threshold is continuously adjusted according to the feedback of previous home migration decisions at runtime. n We implement and evaluate this protocol in a distributed JVM. 5/22/2021 wjfang@csis. hku. hk 25
Questions? 5/22/2021 wjfang@csis. hku. hk 26
- Slides: 26