Visualizing kernel scheduling
Behind Time
SchedViz [1] is one of a variety of open source tools recently released by Google that allows you to visualize how your programs are being handled by Linux kernel scheduling. The tool allows you to see exactly how your system is treating the various tasks it is running and allows you to fine-tune the way resources are allotted to each task.
SchedViz is designed to overcome a specific problem: The basic Linux tools available for scheduling [2] don't allow you to see very much. In practice, this means that most people guess how to schedule system resources, and given the complexity of modern systems, these guesses are often wrong.
Multiprocessing
Modern operating systems (OSs) execute multiple processes simultaneously by splitting the computing load across multiple cores and running each process for a short time before switching to a different task (multiprocessing). This feature presents a significant challenge for engineers: Where should each process run and for how long? How should you assign priority to the various tasks that your system needs to run?
A round-robin approach would assign each task processing time in such a way that each would receive equal time. In practice, however, some tasks – such as those related to the core functions of your OS – are of higher priority than others.
SchedViz makes use of a basic feature of the Linux kernel: the ability to capture data in real time about what each core of a multicore system is doing. The kernel is instrumented with hooks called tracepoints; when certain actions occur, any code hooked to the relevant tracepoint is called with arguments that describe the action. This data is referred to as a "trace."
SchedViz captures these "traces" and allows you to visualize them. A command-line script
...Buy this article as PDF
(incl. VAT)