HOMEWORK 3 Due Date: November 19, 2004 1. Consider the 3-phase commit protocol state diagram in Appendix. What are the members concurrency set of the state W1, i.e., C(W1)? What are the members of the sender set of the state W1, i.e., S(W1)? Do you need to add any failure/timeout transitions from the state W1? If so, explain how you will add them and why. (Note that W1 is the wait state at the coordinator). 2. A distributed system using shared memory employs objects paradigm. Here, data structures to be shared among different processes are viewed as objects with different properties (similar to the Munin system discussed in class). This system migrates objects on-demand to sites that have processes requesting for access to the objects. Hence, this system suffers from object thrashing problem. Assume that the sites in the distributed system use round-robin process scheduling by allotting equal time-slices for each running process. a. Suggest technique(s) for avoiding/reducing object thrashing. Discuss the merits/demerits of the suggested technique(s). b. If this distributed shared memory architecture is augmented by replication for read/write, explain whether the system suffers from the problem of false sharing? 3. Synchronous checkpointing algorithm uses control messages such as Take_a_tentative_ckpt and Make_tentative_ckpt_permanent. Write the message complexity of the above 2 messages and justify why. 4. Sender-initiated load sharing algorithms suffer from inefficiency at high loads. The reason is that most nodes are senders and send messages on the network to find receivers. Since it is difficult to find receivers in highly loaded conditions, these messages add to the load on the system resulting in inefficiency. Are there any conditions in which receiver-initiated load sharing can become inefficient in a similar manner? If so, explain the condition(s) with reasons. If not, justify why receiver-initiated load sharing is not inefficient. Answer: Condition: when most sites are receivers and very few sites are highly loaded. Reason: Many receivers will try in vain to locate the few available senders, generating wasteful traffic. 5. Consider a distributed shared memory with the following procedures for handling write and read faults. a. Processor i has a write-fault on page p: i. i finds owner of p ii. p’s owner sends the page + copyset (i.e., the processors having read-only copies). Owner marks its page table entry of p as nil. iii. i sends invalidation messages to all processors in the copyset. b. Processor i has a read fault to a page p: i. i finds the owner of p. ii. p’s owner sends a copy of p to i and adds i to the copyset of p In the above system, consider a Processor P1 that owns a page p. Another processor, P2 wants to read p, but does not have page p in its memory. Also, P2 wants to write on page p after reading data in it. (a) Explain the sequence of actions that will be carried out for P2’s read and write operations. (b) Comment on the efficiency of the procedures followed by the above distributed shared memory system. If needed and possible, suggest ways to improve the efficiency. Answer: a. P2 request P1 for read of p. After reading, P2 again requests P1 for write of p. b. Inefficient because of possible double fault. Improvement: sequence number can be checked by owner before transferring p to the writer. 6. One way of optimizing non-token based algorithms is to reduce the number of messages required per critical section invocation. For instance, Ricart-Agrawala algorithm reduces message exchanges to 2*(N-1) and Maekawa tries to reduce N itself (by considering a subset of N as the request set). How do you think token-based algorithms try to optimize? (Don’t write more than 2 or 3 sentences). Answer: Token-based algorithms try to optimize the way the token holder is located. Improving on the broadcast oriented approach used by Suzuki-Kasami algorithm, Singhal’s heuristic algorithm tries to classify sites into possible token holders and not token holders. Thereby reducing the number of token request messages communicated. Raymond’s algorithm improves on it further by designating the token holder to be the root of a tree. 7. Consider the following space-time diagram. Process X wants to take a checkpoint at time t. Trace the execution of the synchronous checkpointing algorithm and explain how checkpoints will be taken in the system. Do you have any conclusion/inference to state about the algorithm based on this example? Draw the space-time diagram showing all the checkpoint request messages. (Brief, to-the-point explanations are a must to get full credit). Answer: X: ckpt_cohot for X is {Y}. It tells Y to take a tentative checkpoint. Since Y sent a message after the previous checkpoint, it takes a tentative checkpoint and looks it cohort set. That has Z in it. It sends Z a message to take tentative check point. Z takes tentative checkpoint. Its ckpt_cohort has X in it. So it sends a messge to X to take a tentative checkpoint. Since X has already take the checkpoint, it simply sends OK to Z. Z sends OK to Y and Y sends OK to X. X asks Y to make the checkpoint permanent. Y tells Z, Z tells X too. Note, Y’s last message should not be included in the checkpoints and the checkpointing activity has to complete before Y’s last message transmission. Conclusion: a process may get more than 1 Take_ckpt request message. By using the condition that message exchanges are not allowed between phases, the algorithm terminates. (Otherwise, it can make processes take checkpoints infinitely !). Checkpoint request X t Y Z 8. One of the problems associated with preemptive process migration is that a process’s execution needs to be frozen before it is migrated. One possible way of reducing this freezing time is to migrate the process status and code while leaving behind the data in the old parent host. The new parent host can then pick up the data (from the old host) as and when needed. However, this scheme suffers from the problems of residual dependencies. An operating system designer wants to avoid residual dependencies for this situation by using a file server. a) Suggest a simple design for using a file server for reducing residual dependencies (just list the points, no long paragraphs). Answer: 1) Data, code, and status pages can be copied onto the file server. 2) Old parent host can continue to execute the process even when the copying process is going on. 3) Modified pages (during the time between previous copy and the execution) can be copied again to the file server. 4) Steps 2 and 3 can be repeated few times, if needed. 5) Process execution can be frozen in the old host. 6) Code, status can be copied to new host. 7) Data can be acquired by the new host from the file server either on-demand or as a one time transfer, later. b) Are there any identifiable drawbacks in using the file server approach (for process migration)? Answer: 1) File server can become a bottle-neck with several such migrations. 2) Fault tolerance low since the process depends on new host + file server. 3) Other suitable points given due credit. 9. We discussed the coherence protocol followed by the PLUS distributed shared memory system. This system uses a page size of 4Kbyes and a memory access & coherence unit of 32-bis word. Here, the site that needs to update a memory item sends the request to the site that is designated as Master for that memory item. This master site propagates the update through a distributed linked list. a) One problem with the above approach is that reads during the distributed update process can return obsolete values. Suggest a suitable design that can ensure a read will always return the latest updated value. Answer: Need to use write invalidate protocol. This can be done using the distributed linked list. Or by using a full list maintained on the master site. b) Identify any significant drawback of your design. Answer: If update is needed after invalidation, it is twice the job. Also, if full list is maintained at master site, list space will be very high (for all shared variables).