Kernel Monitoring Framework and Thread Context Logging

overview of the lab 1 assignment kernel n.w
1 / 6
Embed
Share

Dive into the design and evaluation of single-threaded and multi-threaded kernel modules focusing on thread management, context switches, and system performance indicators like voluntary and involuntary context switches. Understand the impact of timer intervals on context switch behavior for optimal core utilization in operating systems.

  • Kernel Monitoring
  • Thread Management
  • Context Switches
  • Performance Indicators
  • Core Utilization

Uploaded on | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Overview of the Lab 1 Assignment: Kernel Monitoring Framework Chris Gill CSE 422S Operating Systems Organization 1

  2. Single-Threaded Kernel Module Design When loaded, the single-threaded module will spawn a thread, remember the thread s task_struct, and start a recurring timer (with a default rate, or per parameters if they were provided) Init() run wake work wake work wake Each time the timer expires, it should wake up the thread, which (until it s told it should stop) then prints info to the system log, and suspends itself until awoken again work wake work . . . wake stop Make sure exit stops the thread and cancels the timer exit() CSE 422S Operating Systems Organization 2

  3. What Information is Logged? The thread (and each thread in the multi-threaded kernel module) records its own voluntary and involuntary context switches A voluntary context switch happens when a thread or process blocks or intentionally yields its execution, due to a system call it makes An involuntary context switch happens when the scheduler chooses to run another thread or process instead of the current one struct task_struct { unsigned long nvcsw; unsigned long nivcsw; }; sched_yield () user space kernel space schedule () schedule () CSE 422S Operating Systems Organization 3

  4. Multi-Threaded Kernel Module Design When loaded, the multi-threaded module will (in addition to functionality of single threaded module) also spawn extra threads: total of one per core Init() run wake work wake Pin each thread to its own core work wake Make sure the module remembers the pointer to each thread s task_struct work . . . wake Make sure exit stops all threads (as well as canceling the timer) work wake stop exit() CSE 422S Operating Systems Organization 4

  5. Evaluation Runs The numbers of voluntary and involuntary context switches between threads are good indicators of contention for cores Voluntary context switches occur when a thread finishes the function it is performing and yields or blocks its execution Involuntary context switches occur when a thread isn t finished performing its function yet, but is preempted by another thread Make sure that your evaluation runs cover different time scales so you see meaningful differences in the relative numbers of voluntary vs. involuntary context switches Especially, try running with shorter (towards 1 millisecond) and longer (towards a second) timer intervals to assess this CSE 422S Operating Systems Organization 5

  6. Lab Write-up As you work, please record your observations in detail It s a good idea to read the entire assignment, and to plan and design a bit before starting to work on it It s also a good idea to develop and test incrementally Develop kernel module with just a timer, log timeouts Test default timeout behavior, different specified timer intervals Add a thread, test wakeup, suspend, and stop behavior (save a copy) Spawn multiple threads, bind them to specific cores Use kernel tracer to examine (and debug) module behavior Write a cohesive report that analyzes, integrates, and offers explanations for what you observed Document the thinking behind your design Attribute sources for any code or design ideas you obtained from elsewhere (caveat: only use what you understand, and know to be correct) Explain not only what you did and what you saw, but also why you did that, and why you think what you saw happened CSE 422S Operating Systems Organization 6

More Related Content