Processor Capacity Reserves: Operating System Support for Multimedia Applications Mercer, Savage, and Tokuda 1 Introduction Multimedia applications require that operating systems support time-constrained data types such as digital audio and video in a responsive and predictable way. The general purpose resource management policies found in most operating sytems are incompatible with these strenuous timing constraints, and traditional real-time systems are also poorly matched to the multimedia application environment since user demands dictate a dynamically changing mix of both real-time and non-real-time activities. Moreover, supporting commercial "shrink-wrapped" real-time multimedia software has the additional requirement that the operating system must provide a sensible framework for controlling and communicating resource usage among independent real-time activities. 1.1 Our Solution Processor capacity reservation mechanism, which allows the user to control the allocation of processor cycles among programs Support real-time and non-real-time activities Applications request reservations. Once granted, guaranteed. Can be modified at any time, subject to availability. New kernel abstraction: reserve. - tracks the reservation and measures the processor usage of each program Reserves can be passed across protection boundaries via IPC. Could be used by a QoS Manager to control resource allocations. Seperates policy and mechanism; reserves are the mechanism. 1.2 Current state of the art Primitive scheduling support. Priority schemes don't work that well. 1.3 ----- 2 Our reservation strategy The reservation strategy must: 1. Provide some means for application programs to specify their processing requirements 2. Evaluate the processor requirements of new programs to decide whether to admit them or not 3. Schedule programs consistently with the admission control policy 4. Accurately measure the comptuation time consumed by each program to ensure that programs to not overrun their reservations 2.1 Capacity Specification Processor percentage Worst-case assumptions - leftovers given to background processes. Aperiodic assigned a rate just like periodic 2.2 Admission Control Summation of resource usages - 100% assuming EDF - 69% using RM 2.3 Scheduling Must be compatible with the admissions control policy. 2.4 Reservation Enforcement Measure duration between context switches. More accurate than sampling. Also tracks server resource usage (i.e. not bound to any one thread of execution). This is critical. Possible because it's built on Mach. ----- 3 Admission Control and Scheduling 3 values describe a process rho = C/T (computation over period) Provide feedback for refinement of C. D = S/rho (delay = service time/rho) 3.1 Admission Control under Fixed Priority Scheduling .69 limit, with rest going to background processes Or, use exact analysis to determine if higher bound is possible Assumptions for .69 bound 1. Programs are periodic 2. Constant computation time 3. Preemptive, with zero context switch time 4. Independent, i.e. no synchronization or communication 3.2 Admission Control under Dynamic Priority Scheduling ----- 4 Reservation Enforcement and Reserves Reserves track resource usage Timesharing when reserve has been used up. Cannot stop a process anywhere in a kernel thread, but can penalize it on its next iteration. 4.2 Microkernel Accounting Reserves have to be passed among servers (user-level and system-level) used by the process/activity. ----- 5 Performance Evaluation 5.1 Unreserved Periodic Thread One thread alone works fine Multiple threads do poorly under Mach's time-sharing protocol because they compete for resources. 5.2 Reserved Periodic Threads Works well. 5.3 Server Invocation with no reservation Works poorly 5.4 Server invocation with reserve Works well ----- 6 Future work User interface or higher-level server manages reservations for individual processes. Reserves for other resources. Their position: these are easier because they are discrete Reserves for distributed multimedia systems - distributed reserves -----