CS 452/652 Winter 2022 - Lecture 28
March 18, 2022
prev next
Priority Inversion
- lower-priority tasks indirectly keeps higher-priority task from running
- performance (latency) problem
- correctness problem (starvation), if system fully loaded
- examples: lower number = higher priority
- example scenario A
- t1 sends to t10, then t5 preempts
- t5 preempts work done for t1
- ⇒ adjust server priority to current client's priority
- example scenario B
- t10 sends to t1, then t5 wants to run
- t1 runs on behalf of t10, so t5 should be able to preempt
- ⇒ adjust server priority to current client's priority
- example scenario C
- t10 runs on behalf of t8, t7 preempts, then t5 wants to send to t10
- t7 keeps t10 from completing its computation, t5 blocked
- ⇒ boost server priority to waiting client's priority
- also: priority-based Send queues?
Sensor Processing
- intuition: run sensor querying at highest possible priority
- caveat: track communication is half-duplex
- sensor reports → track commands
- ordering track commands vs. next sensor query?
Context-Switch Testing
- computation / loop with easily verifiable results
- high register coverage
- use subroutine, recursion (to a limit)
- trigger frequent timer interrupt
- randomized timeout
- interrupt handler (kernel): perform similar computation
- clobber as much state as possible
- test with and without optimization
Kernel Testing
- repeat speed measurements as kernel testing method
- should see similar measurements
- test reliability of train commands
- speed variation and timing
- change direction and verify using sensors
- add lights on/off to increase command intensity
Train Control Robustness
- insert "Chaos Monkey" at track server
- fake or suppress reports/commands