______ Operating Systems (CS 273 (OS), Fall 2020)
Home
>>    




Operating Systems

CS 273 (OS), Fall 2020

(Version 5.0.21)

Process table

  • The process table is called task_struct, and is defined in task_struct.

Scheduler; context switching

  • The scheduler is called schedule(), defined in schedule.

  • sched_submit_work() updates Linux's bookkeeping to prevent I/O deadlocks if a process is becoming blocked. Deadlock means that there is a collection of processes, each blocked waiting for an event that can only be caused by another process in that collection. (Will study deadlocks later.)

  • __schedule performs more deadlock prevention (preemp_disable()) and some IPC operations ("read/copy/update" synchronization operation rcu_note_context_switch(), raw_spin_lock_irq(), etc.), then calls context_switch

    • switch_to includes some of the register movements, saving from outgoing process and obtaining values for incoming process.

    • Paravirtualization -- for making low-level tweaks of kernel for bare hardware vs. a virtual machine.

      arch_start_context_switch implemented using PVOP_VCALL1() macro, which is ultimately defined in terms of another macro ____PVOP_CALL implemented using assembly calls.

    • Macro prepare_arch_switch - insures that a specific assembly-level computation doesn't get optimized away by compiler, by inserting an empty computation that won't be "crossed" by optimization rewriting.