Scheduler
- Linux: Kernel Scheduling
- Influence scheduling priority with nice and renice
- Chapter 10 Process Scheduling - Understanding the Linux Kernel
- Linux Kernel 排程機制介紹
- aSMP(Asynchronous Symmetrical Multi-Processing) vs. vSMP(Variable Symmetrical Multi-Processing)
- Analyzing the Effectiveness of Multicore Scheduling Using Performance Counters
- path_to_kernel/include/sched.h
- struct task_struct
- int prio
- int static_prio
- int normal_prio
- struct sched_class *sched_class
- struct sched_entity se
- unsigned int rt_priority
- Preemption
- A preempted process is not suspended, because it remains in the TASK_RUNNING state.
- Preemption and Context Switching
- dispatch latency
- need_resched flag
- User Preemption
- planned/forced process switch
- Kernel Preemption
- preempt_count field
- preempt_enable/preempty_disable
- preempt_check_resched
- preempt_schedule, preempt_schedule_irq
- 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 ?
- set state to NOT TASK_RUNNING
- Preempty happens(maybe interrupt happen and preempt_schedule_irq() is called after interrupt handler terminated) (state != TASK_RUNNING && preempt_count == PREEMPTY_ACTIVE)
- 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
- struct sched_class
- Priority Inversion Problems
page revision: 126, last edited: 22 May 2014 14:39