CS 656 Final Exam Please work on this exam on your own. Exam is subject to honor code. This exam is due by 11:59pm Wednesday May 11th. Please e-mail answers only in pure text form to: zaher@cs.virginia.edu Please use subject line: “CS656 FINAL ANSWERS” (in uppercase letters) Please work on this test for no more than 5 hours. Q1: A video-on-demand server has 10 clients. The clients have the resource requirements (i.e., demand) and utility values indicated in Fig 1. In your favorite programming language, write a short program to assign QoS levels to clients in a way that maximizes the total utility. Assume that the sum of all client resource requirements (i.e., demand) must be no more than 100. What is the maximum attainable total utility? (4 points) Client 1 Client 2 Client 3 Client 4 Client 5 Client 6 Client 7 Client 8 Client 9 Client 10 Client 11 Client 12 QoS level 1 Demand Utility 8 11 18 23 22 27.3 16 22.1 10 13.2 20 16.6 14 10.1 16 25.7 10 13.9 14 17.3 20 32.1 14 12.1 QoS level 2 Demand Utility 6 8.5 14 16.7 8 11.3 10 10.2 4 9.1 12 13.1 10 8.7 10 19.4 8 12.1 12 12.2 10 9.9 8 5.1 QoS level 3 Demand Utility 2 4.1 4 8.9 6 7.9 8 5.7 2 5.2 10 9.3 2 1.2 8 3.8 6 3.3 10 4.5 4 7.1 6 4.6 Fig 1: The resource demand and utility of clients’ QoS levels. Partial credit rules: Correct answer: 4 points. Less than 0.25% error: 3 points. Less than 1% error: 2 points. Less than 2% error: 1 point. Larger errors: no credit. For purposes of grading, the percentage error in your answer is computed as follows: Error = |100* (your answer – correct answer)/(correct answer)| % Q2: You are trying to estimate the overhead of the timer interrupt on your machine. To do so, you created a program that executes an infinite loop that initializes then inverts the same large matrix repeatedly. The program outputs the average number of times this loop was executed per second, rounded to the nearest integer. To estimate the timer overhead, you configure the timer to interrupt at a particular period then run your program and record its output. You plot the output of your program for different values of the timer period. The results are shown in Fig 2. What approximately (in microseconds) is the overhead of the timer interrupt? (2 points) Timer interrupt period (ms) Matrix inversions per second 100 2314 10 2313 1 2302 0.1 2198 0.01 1157 Fig. 2: Evaluation of timer overhead Partial credit rules: Less than 1% error: 2 points. Less than 5% error: 1 point. Larger errors: no credit. For purposes of grading, the percentage error in your answer is computed as follows: Error = |100* (your answer – correct answer)/(correct answer)| % Q3: In some system, processor capacity reserves are used for temporal isolation among a set of real-time threads. EDF scheduling is used as the underlying operating system scheduling policy. If requests for capacity reservation arrive in the order shown in Fig. 3, which of these requests are granted and which are denied? (2 points) Arrival time Requested budget Requested period Request 1: t = 10 2 20 Request 2: t = 14 40 50 Request 3: t = 19 5 35 Request 4: t = 21 3 33 Fig 3: Request arrival times and reservation parameters Q4: The reservations shown in Fig 4 are requested from the Rialto scheduler. The scheduler adopts a minimum period of 10 ms. Which of these requests are granted and which are denied? (2 points) Arrival time Requested budget Requested period Request 1: t=4 3 15 Request 2: t=9 14 70 Request 3: t = 13 10 25 Request 4: t = 20 15 76 Fig 4: Request arrival times and reservation parameters Q5: The operating system kernel on some server machine classifies all incoming requests and immediately discards all those requests that originate from “blacklisted” sources. Requests that are deemed “legitimate” are forwarded to a user-space server process for further handling. It takes 10 microseconds to classify a request, 240 microseconds to perform kernel processing on legitimate requests, and 750 microseconds to perform user space processing. A denial-of service attacker would like to generate enough traffic to prevent the user space process from ever getting the CPU. (2 points) a) How many requests per second does the attacker have to generate if it not yet blacklisted? b) How many requests per second does the attacker have to generate if it is blacklisted? Q6: What is the size of the routing table in Pastry (please exclude the leaf set and the neighborhood set) if the network is composed of 1000 machines and node IDs are expressed in base 4 numerals? (1 point) Q7: Goyal’s hierarchical CPU scheduler is used on some server platform. The weights allocated to the CD burner, media player, and editing applications are 3, 5, and 2 respectively. What percentage of CPU time is available to the CD burner? (1 point) Q8: Please answer true or false: (3 points) a) IO-Lite improves Web server throughput more for those servers that serve dynamic content compared to servers that serve static content only. b) A disadvantage of soft timers is that they do not occur with exact periodicity. c) A disadvantage of the smart scheduler is that it does not address fairness in resource allocation among same-priority tasks. d) A disadvantage of software adaptation as a means to reduce energy consumption of mobile applications such as map viewing is that it does not adequately reduce power consumed by the mobile device when the processor is idle. e) It can be inferred from Schmidt’s results that if the server machine used in the SLIM paper was connected to its clients via a 100Mbps switched Ethernet, the main bottleneck of the architecture would likely to lie in the network. f) In Samsara, a disadvantage of claim forwarding is that it may reduce the total amount of disk left for storing regular data files compared to the case where no forwarding is used. Q9: Pillai’s cycle conserving RT-DVS algorithm is used to decide on processor frequency for the task set shown in Fig. 5. Assume that the beginning of the periods of all tasks coincide at t=0. The processor supports 1GHz, 800 MHz, 700 MHz, 600 MHz, 500 MHz and 400 MHz frequencies (for simplicity, assume that GHz = 1,000,000,000 Hz and MHz = 1,000,000 Hz). All execution times given in Fig. 5 are for the maximum processor frequency. The execution time is inversely proportional to frequency. Note that only the maximum execution time of each task is known a priori. The actual execution time of a task is not known until the task terminates. The processor uses EDF scheduling. At which frequency will the processor operate at each of the following time instants: t=0.4, t=1.4, t=2.3, t=4? (2 points) Task 1 Task 2 Task 3 Max Execution time Actual Execution time 1 0.4 2 1.4 1 0.75 Period 5 10 20 Fig. 5: The scheduled task set Q10: In the problem above, at which frequency will the processor operate if it is to use Pillai’s static voltage scaling? (1 point) Good luck. Please e-mail your answers in pure text to: zaher@cs.virginia.edu Please use subject line: “CS656 FINAL ANSWERS” (in uppercase letters) ------------------- Answer text form (replace underscores with answers) -------------------1. Utility = ____________ 2. Timer interrupt overhead (in microseconds) = ____________ 3. Request 1: Request 2: Request 3: Request 4: _______ _______ _______ _______ 4. Request 1: Request 2: Request 3: Request 4: _______ _______ _______ _______ 5. (a) _________ (b) _________ 6. _________ 7. _________ 8. (a) ____ (b) ____ (c) ____ (d) ____ (e) ____ (f) ____ 9. Processor frequency at t=0.4: ______, t=1.4: ______, t=2.3: ______, t=4: ______ 10. Processor frequency = _________