Kernel Thread Queue Delay Measurement via Notification Listener
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing operating systems face challenges in quickly and accurately identifying performance issues related to thread scheduling, leading to inefficient debugging and development processes due to the complexity of detecting root causes of performance problems.
Innovation Solution
The implementation of a scheduler in the operating system that allows user-level application software to assign maximum delay times to threads, with monitoring logic that records insertion and removal times from queues, generating events when thresholds are exceeded, enabling precise measurement and re-prioritization of threads.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If traditional operating system scheduling is used, then system operation is maintained, but performance issues related to thread scheduling delays cannot be quickly or accurately identified
Solution Approach 1:
The patent introduces a notification listener as an intermediary component that sits between the scheduler and the application. The listener receives notifications about thread scheduling events (insertion into run queue, removal from run queue) and calculates delays based on timestamps. This intermediary approach enables precise measurement of scheduling delays without requiring complex modifications to the core scheduling algorithm itself.
Solution Approach 2:
The notification listener performs self-service by autonomously monitoring scheduling events, recording timestamps, calculating delays, and generating notifications when thresholds are exceeded. The system automatically tracks its own scheduling performance without requiring external intervention or complex external monitoring infrastructure.
2Loss of time
If maximum delay times are enforced with re-prioritization, then thread response time is improved, but system complexity increases due to additional monitoring and event generation
Solution Approach 1:
The patent implements preliminary action by recording the insertion timestamp when a thread is added to the run queue, before the actual scheduling delay occurs. This pre-recording of baseline timing data enables accurate calculation of the actual delay when the thread is removed, allowing the system to proactively identify and respond to scheduling issues before they significantly impact performance.
Solution Approach 2:
The notification listener implements feedback by continuously monitoring scheduling delays and generating notifications when the calculated delay exceeds the maximum allowed delay time. This feedback mechanism allows the system to detect performance issues and trigger re-prioritization actions, creating a closed-loop control system that actively manages thread scheduling performance.
3Loss of information
If per-thread delay measurement is implemented, then scheduling performance visibility is improved, but computational overhead increases
Solution Approach 1:
The patent applies local quality by implementing per-thread delay measurement only for threads that are relevant to performance monitoring, rather than uniformly monitoring all threads in the system. The notification listener can be configured to monitor specific threads or thread types, concentrating computational resources on critical paths while reducing overhead for less important scheduling operations.
Data Source
AI summary
In general, techniques of this disclosure relate to measuring scheduling performance of monitored threads in an operating system with improved precision. In one example, a method includes inserting, by an operating system kernel, a monitored thread into a queue comprising one or more threads and recording an insertion time that the monitored thread is inserted into the run queue; receiving, by the kernel, an event to remove the monitored thread from the run queue; responsive to receiving the event, determining, by the kernel, an amount of time that the monitored thread is stored on the run queue based on the insertion time and a removal time at which the monitored thread was removed from the run queue; and when the amount of time the monitored thread is stored on the run queue is greater than or equal to a specified threshold, sending a notification to a notification listener.


