Midterm Review David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO 63130
CSE 522S – Advanced Operating Systems Exam Scope Questions derived from slides Split between comprehension and analysis Studios useful for analysis & concepts 9 questions 81 minutes 9 minutes per question Does not cover “details” slides (i.e. boot process and program execution) CSE 522S – Advanced Operating Systems
CSE 522S – Advanced Operating Systems Course Concepts Kernel execution: Timing: System calls Time sources Interrupt handlers Timers Kernel threads Timer granularity Benchmarking Kernel Programming: Tracing: Kernel modules Core kernel image Kernel tracing System call tracing CSE 522S – Advanced Operating Systems
CSE 522S – Advanced Operating Systems Course Concepts Processes: Kernel Synch: Process creation Mutexes Process address space Spinlocks Deadlock Race Conditions Scheduling: O(1) Scheduler CFS Scheduler Real-Time Scheduler Scheduler tensions CSE 522S – Advanced Operating Systems
CSE 522S – Advanced Operating Systems Example Question #1 Imagine you are implementing a new OS feature that communicates with user space. User programs request an action from the kernel, and the kernel returns some data. Consider two options for the interface: Give two advantages of implementing a new system call (4 points): Give two advantages of using a kernel module that reads and writes files (4 points): If you decide to use a kernel module. What must end users do in order to use your future software patches (2 points)? CSE 522S – Advanced Operating Systems
CSE 522S – Advanced Operating Systems Example Question #2 You have a periodic system where the scheduler is invoked every 1ms to reschedule tasks, and your system has five tasks, which will consume 3ms, 3ms, 4ms, 5ms, and 7ms of processor time. Suppose your system schedules tasks in FIFO order, what is the longest a task might wait before being scheduled (4 points)? Suppose your system schedules tasks in round-robin order, what is the longest a task might wait before being scheduled (4 points)? Rank the round-robin and FIFO schedulers as as either “HIGH” or “LOW” for each of: response time, overhead, fairness (6 points). CSE 522S – Advanced Operating Systems
CSE 522S – Advanced Operating Systems Example Question #3 Suppose you’re writing a new feature with a shared data structure. For each of the situations below, say whether to use a mutex or a spinlock and argue why (3 points each): A large data structure that takes a long time to process. After your lock, accessing the structure requires taking a separate mutex lock. The data structure will be accessed from interrupt context. Why should you disable interrupts when accessing a spinlock that is also used by interrupt handlers (3 points)? CSE 522S – Advanced Operating Systems