Scheduler
  • path_to_kernel/include/sched.h
rb_tree.gif
  • struct task_struct
    • int prio
    • int static_prio
    • int normal_prio
    • struct sched_class *sched_class
    • struct sched_entity se
    • unsigned int rt_priority
  • the delay between the time they become runnable and the time they actually begin running.
  • Schedule Functions
  • [path to kernel]/kernel/sched.c
  • schedule()
    • the main scheduler function
    • The act of picking the next task to run and switching to it is implemented via the schedule() function.
    • if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) Re: use of PREEMPT_ACTIVE ?
      1. set state to NOT TASK_RUNNING
      2. Preempty happens(maybe interrupt happen and preempt_schedule_irq() is called after interrupt handler terminated) (state != TASK_RUNNING && preempt_count == PREEMPTY_ACTIVE)
      3. put task into wait queue by calling schedule()(state != TASK_RUNNING && preempt_count !=PREEMPTY_ACTIVE)
  • Load Balancing
  • Scheduling Classes
  • [path to kernel]/include/linux/sched.h
    • struct sched_class
      • enqueue_task
      • dequeue_task
      • yield_task
      • pick_next_task
      • put_prev_task
  • Priority Inversion Problems
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License