SuperPass: Fast-Tracking Blocking Threads to Mitigate Priority Inversion
9 hours ago
- Priority inversion occurs frequently on Android, causing high-priority threads like UI threads to be blocked by lower-priority threads for up to 210 ms, leading to dropped frames.
- Existing real-time system solutions (e.g., priority inheritance, real-time UI promotion, Proxy Execution) fail to eliminate long priority-inversion blockings on Android and may introduce high overhead.
- Two key insights: long blockings stem from accumulated CPU waiting time of low-priority blocking threads, not critical-section latency; tracking a limited number of concurrent readers is sufficient for good responsiveness with low overhead.
- SuperPass is a lightweight kernel mechanism that fast-tracks low-priority threads blocking latency-critical threads, using a scheduler fast track and a lock-level detector to identify most such threads.
- Evaluation on Google Pixel 8 shows: 72.0% reduction in 99.9th-percentile blocking duration, 47.7% reduction in blocking count, 29.2% reduction in janky frames, with only 0.74% CPU overhead.