Tentamen vid Institutionen för Datavetenskap, Linköpings universitet TENTAMEN TDDB47 Realtidssystem (Real-time Systems) Date: 9 August 2006 Time: 14-18 Room: TER1 Contact Teachers: Simin Nadjm-Tehrani (Tel: 282411, 070 2282412) Calin Curescu (Tel: 281937, 073 1504355) Material: English-Swedish-English dictionary Calculator Total: 40 points Assessment: F, 3, 4 and 5: Fail: 3: 4: 5: 20 27 34 - 19 p 26p 33 p 50 p INSTRUCTIONS: Write your name, class and personal number (sv. personnummer) on each sheet of paper that you hand in. Further, pages should only contain one answer per page (answers to subquestions can be on the same page). You are asked to only answer on the front page of the paper. Sort all the sheets that you hand in with respect to the number of the question. Make sure your answers are presented clearly and precisely. Points will not be given to answers that cannot be read due to bad handwriting. Your answers may be in Swedish or English. Your answers shall clearly show the method for the solution. A correct answer without any explanation will not be given any credits (figures can be of help when describing but should be accompanied by a text description). In those cases where you are in doubt about the question, write down your interpretation and assumptions, and answer the question based on the interpretation. Note, a correct answer embedded in errors may give reduction in points, so make sure your answers are to the point. Results are reported no later than August 25th. Good luck!!! Simin Nadjm-Tehrani Examiner for TDDB47 Tentamen vid Institutionen för Datavetenskap, Linköpings universitet Q1: Scheduling a) The Mars rover “Path Finder” landed for the first time on 4th July 1997. There are 4 computational processes that share the same processor on board: the trajectory following process (Pt), the sensor coordination process that configures sensors for different measurement missions and reads their values(Ps), the data storage process that records the sensor values on stable memory(Pd), and the communication process that relays information to ground control(Pc). The execution periods and worst case execution times for these processes can be summarized as follows. Task Pt Ps Pd Pc Period(ms) 1500 500 3000 500 WCET(ms) 100 100 1000 200 Assume that the processes are to be run as independent processes. Construct a cyclic scheduler and present your minor and major cycles. Document any other assumptions that your solution depends on. (3 points) b) In order to reduce processor utilization one has decided to replace the current communication channel (that is also used by other systems on board), with a dedicated channel that is still used every 500ms, but where each communication has a maximum latency of 50ms. This leads to a new WCET for Pc =50ms. Consider now scheduling with a Rate-monotonic scheduler and assume that the scheduler is run as a periodic process at 100ms intervals, and it takes maximally 10ms to execute (including process suspensions and context switches). Check whether the process set (including the scheduler process) is schedulable according to the rate-monotonic principles. (3 points) c) In order to further improve data transfer overheads it is now planned that the sensor process, the data storage process and the communication processes share a common bus, and run an immediate priority ceiling protocol for resolving conflicts on the bus. Assume that the WCET of the critical section for the sensor coordination process is 50ms, and for the data storage and communication processes, 150ms and 20 ms, respectively. Compute the new response times for the processes involved after introduction of the new bus. (4 points) d) Earliest deadline first (EDF) is considered to be an optimal scheduling algorithm for periodic processes. Explain in what sense EDF is optimal. Under which circumstances could a process set not be schedulable with EDF and schedulable with another algorithm? (2 points) Q2: Dependability a) Improving reliability and availability of a system typically involves the use of redundancy. Explain the notions of static and dynamic redundancy, and give one example of each type. Explain whether dynamic and static Tentamen vid Institutionen för Datavetenskap, Linköpings universitet redundancy management affect the timeliness properties of a system. In particular, explain whether and how the response time of a system is affected, both in absence of faults and in presence of faults. (4 points) b) One example of faults that affect the real-time behaviour of a system is the so called “software aging”. This is the result of a progressive error accumulation that gradually degrades performance and may eventually lead to system failures. Give two examples of such faults. (2 points) c) Identify the causal chain in following phenomenon in terms of faults, errors and failures. a. Loss of the fuel unit during the mission of the space shuttle Discovery due to of adverse environment conditions during takeoff that led to loss of some binding mechanical linkage shortly after take off. b. 50% of invoices for the month of July remain unpaid for organisation X since the electronic authorisation system is dependent on a feature of a given browser that could hang the browser if the correct version is not in use. c. Booking data from the travel agents arrive with a larger delay than expected at a central ticketing system, so that flights for a given week of summer are oversold by 20%. (3 points) Q3: Design a) What are the main activities that need to be supported by a design method which is applicable to real-time systems? Provide a brief description of each activity. (4 points) b) What are the main difficulties in estimating worst case execution times of real-time processes? Give an example of a technique used to compute realistic estimates for a given executable code. (2 points) Q4: Distributed systems & QoS a) For a single node (monolithic) system a typical fault hierarchy is presented as: crash faults, omission faults, timing faults, and Byzantine faults. These reflect the degree of complexity in methods needed for detection and tolerating the type of faults in an increasing order. What are the additional fault modes in a distributed system? . (2 points) b) What is meant by the notion of Quality of Service (QoS)? Give a short description of a technique to enforce differentiated QoS. (4 points) Tentamen vid Institutionen för Datavetenskap, Linköpings universitet Q5: Real-time databases and operating systems a) Database services provide logical consistency among the data items. Explain the additional notion of temporal consistency that is present in real-time databases, and explain the relation between temporal consistency and logical consistency. (2 points) b) Take a stand on the following propositions and motivate your answer, whether you think the statement is true or false: a. Real-time operating systems share all the functionalities of normal operating systems but have other functionalities too. b. Real-time operating systems are not needed since a bare machine can be equipped with an application that incorporates its own run-time system in an integrated manner. c. An operating system vendor cannot guarantee the worst execution time of the context switching operations as the operation depends on the size of the context (i.e. the application). (3 points) c) Provide an example application in which data has a validity interval and the frequency of running the update processes for that data can be adapted to the validity interval of the data as well as the current load of the system. (2 points) Tentamen vid Institutionen för Datavetenskap, Linköpings universitet Notation for Tasks/Processes • C - Worst-case-execution time of the task • B - Worst-case blocking time • n - Number of tasks in the system • T - Minimum inter-arrival time (period) of task • R - Worst-case response time of the task Schedulability test Rate Monotonic algorithm: ⎛ Ci ⎞ ⎟⎟ ≤ n(21 / n − 1). i =1 ⎝ i ⎠ n ∑ ⎜⎜ T Response time analysis Ri = C i + Bi + • • wi n +1 ⎡ Ri ⎤ ⎢ ⎥ *C j ∀j∈hp ( i ) ⎢ T j ⎥ ∑ Where hp(i) contains the tasks that have a higher priority than task i Solved using recurring equations: = C i + Bi + ⎡ wi n ⎤ ∑ ⎢ ⎥C j ∀j∈hp ( i ) ⎢ T j ⎥