#include <linux/mm.h>#include <linux/kernel_stat.h>#include <linux/fdreg.h>#include <linux/delay.h>#include <linux/interrupt.h>#include <linux/smp_lock.h>#include <linux/init.h>#include <asm/io.h>#include <asm/uaccess.h>#include <asm/pgtable.h>#include <asm/mmu_context.h>#include <asm/semaphore-helper.h>#include <linux/timex.h>Include dependency graph for kernel/sched.c:

Go to the source code of this file.
Defines | |
| #define | cpu_curr(cpu) aligned_data[(cpu)].schedule_data.curr |
| #define | idle_task(cpu) (&init_task) |
| #define | can_schedule(p) (1) |
| #define | related(p1, p2) |
| #define | TVN_BITS 6 |
| #define | TVR_BITS 8 |
| #define | TVN_SIZE (1 << TVN_BITS) |
| #define | TVR_SIZE (1 << TVR_BITS) |
| #define | TVN_MASK (TVN_SIZE - 1) |
| #define | TVR_MASK (TVR_SIZE - 1) |
| #define | NOOF_TVECS (sizeof(tvecs) / sizeof(tvecs[0])) |
| #define | DOWN_VAR |
| #define | DOWN_HEAD(task_state) |
| #define | DOWN_TAIL(task_state) |
| #define | SLEEP_ON_VAR |
| #define | SLEEP_ON_HEAD |
| #define | SLEEP_ON_TAIL |
Functions | |
| timeval xtime | __attribute__ ((aligned(16))) |
| DECLARE_TASK_QUEUE (tq_timer) | |
| DECLARE_TASK_QUEUE (tq_immediate) | |
| DECLARE_TASK_QUEUE (tq_scheduler) | |
| int | do_setitimer (int, struct itimerval *, struct itimerval *) |
| void | mem_use (void) |
| void | scheduling_functions_start_here (void) |
| static int | goodness (struct task_struct *prev, struct task_struct *p, int this_cpu) |
| static int | prev_goodness (struct task_struct *prev, struct task_struct *p, int this_cpu) |
| static int | preemption_goodness (struct task_struct *prev, struct task_struct *p, int cpu) |
| static void | reschedule_idle_slow (struct task_struct *p) |
| static void | reschedule_idle (struct task_struct *p) |
| static void | add_to_runqueue (struct task_struct *p) |
| static void | del_from_runqueue (struct task_struct *p) |
| static void | move_last_runqueue (struct task_struct *p) |
| static void | move_first_runqueue (struct task_struct *p) |
| void | wake_up_process (struct task_struct *p) |
| static void | process_timeout (unsigned long __data) |
| static void | insert_timer (struct timer_list *timer, struct timer_list **vec) |
| static void | internal_add_timer (struct timer_list *timer) |
| void | add_timer (struct timer_list *timer) |
| static int | detach_timer (struct timer_list *timer) |
| void | mod_timer (struct timer_list *timer, unsigned long expires) |
| int | del_timer (struct timer_list *timer) |
| signed long | schedule_timeout (signed long timeout) |
| static void | __schedule_tail (struct task_struct *prev) |
| void | schedule_tail (struct task_struct *prev) |
| asmlinkage void | schedule (void) |
| void | __wake_up (struct wait_queue **q, unsigned int mode) |
| void | __up (struct semaphore *sem) |
| void | __down (struct semaphore *sem) |
| int | __down_interruptible (struct semaphore *sem) |
| int | __down_trylock (struct semaphore *sem) |
| void | interruptible_sleep_on (struct wait_queue **p) |
| long | interruptible_sleep_on_timeout (struct wait_queue **p, long timeout) |
| void | sleep_on (struct wait_queue **p) |
| long | sleep_on_timeout (struct wait_queue **p, long timeout) |
| void | scheduling_functions_end_here (void) |
| static void | cascade_timers (struct timer_vec *tv) |
| static void | run_timer_list (void) |
| static void | run_old_timers (void) |
| void | tqueue_bh (void) |
| void | immediate_bh (void) |
| static unsigned long | count_active_tasks (void) |
| static void | calc_load (unsigned long ticks) |
| static void | second_overflow (void) |
| static void | update_wall_time_one_tick (void) |
| static void | update_wall_time (unsigned long ticks) |
| static void | do_process_times (struct task_struct *p, unsigned long user, unsigned long system) |
| static void | do_it_virt (struct task_struct *p, unsigned long ticks) |
| static void | do_it_prof (struct task_struct *p, unsigned long ticks) |
| void | update_one_process (struct task_struct *p, unsigned long ticks, unsigned long user, unsigned long system, int cpu) |
| static void | update_process_times (unsigned long ticks, unsigned long system) |
| static void | update_times (void) |
| static void | timer_bh (void) |
| void | do_timer (struct pt_regs *regs) |
| asmlinkage unsigned int | sys_alarm (unsigned int seconds) |
| asmlinkage int | sys_getpid (void) |
| asmlinkage int | sys_getppid (void) |
| asmlinkage int | sys_getuid (void) |
| asmlinkage int | sys_geteuid (void) |
| asmlinkage int | sys_getgid (void) |
| asmlinkage int | sys_getegid (void) |
| asmlinkage int | sys_nice (int increment) |
| static struct task_struct * | find_process_by_pid (pid_t pid) |
| static int | setscheduler (pid_t pid, int policy, struct sched_param *param) |
| asmlinkage int | sys_sched_setscheduler (pid_t pid, int policy, struct sched_param *param) |
| asmlinkage int | sys_sched_setparam (pid_t pid, struct sched_param *param) |
| asmlinkage int | sys_sched_getscheduler (pid_t pid) |
| asmlinkage int | sys_sched_getparam (pid_t pid, struct sched_param *param) |
| asmlinkage int | sys_sched_yield (void) |
| asmlinkage int | sys_sched_get_priority_max (int policy) |
| asmlinkage int | sys_sched_get_priority_min (int policy) |
| asmlinkage int | sys_sched_rr_get_interval (pid_t pid, struct timespec *interval) |
| asmlinkage int | sys_nanosleep (struct timespec *rqtp, struct timespec *rmtp) |
| static void | show_task (int nr, struct task_struct *p) |
| char * | render_sigset_t (sigset_t *set, char *buffer) |
| void | show_state (void) |
| void | daemonize (void) |
| void __init | init_idle (void) |
| void __init | sched_init (void) |
Variables | |
| unsigned | securebits = SECUREBITS_DEFAULT |
| long | tick = (1000000 + HZ/2) / HZ |
| int | tickadj = 500/HZ ? : 1 |
| int | time_state = TIME_OK |
| int | time_status = STA_UNSYNC |
| long | time_offset = 0 |
| long | time_constant = 2 |
| long | time_tolerance = MAXFREQ |
| long | time_precision = 1 |
| long | time_maxerror = NTP_PHASE_LIMIT |
| long | time_esterror = NTP_PHASE_LIMIT |
| long | time_phase = 0 |
| long | time_freq = ((1000000 + HZ/2) % HZ - HZ/2) << SHIFT_USEC |
| long | time_adj = 0 |
| long | time_reftime = 0 |
| long | time_adjust = 0 |
| long | time_adjust_step = 0 |
| unsigned long | global_event = 0 |
| unsigned int * | prof_buffer = NULL |
| unsigned long | prof_len = 0 |
| unsigned long | prof_shift = 0 |
| unsigned long volatile | jiffies = 0 |
| task_struct * | task [NR_TASKS] = {&init_task, } |
| union { | |
| struct schedule_data { | |
| task_struct * curr | |
| cycles_t last_schedule | |
| } schedule_data | |
| char __pad [SMP_CACHE_BYTES] | |
| } | __cacheline_aligned |
| kernel_stat | kstat = { 0 } |
| spinlock_t | runqueue_lock = SPIN_LOCK_UNLOCKED |
| rwlock_t | tasklist_lock = RW_LOCK_UNLOCKED |
| static struct timer_vec | tv5 = { 0 } |
| static struct timer_vec | tv4 = { 0 } |
| static struct timer_vec | tv3 = { 0 } |
| static struct timer_vec | tv2 = { 0 } |
| static struct timer_vec_root | tv1 = { 0 } |
| static struct timer_vec *const | tvecs [] |
| static struct timer_list ** | run_timer_list_running |
| static unsigned long | timer_jiffies = 0 |
| spinlock_t | timerlist_lock = SPIN_LOCK_UNLOCKED |
| rwlock_t | waitqueue_lock = RW_LOCK_UNLOCKED |
| spinlock_t | tqueue_lock |
| unsigned long | timer_active = 0 |
| timer_struct | timer_table [32] |
| unsigned long | avenrun [3] = { 0,0,0 } |
| volatile unsigned long | lost_ticks = 0 |
| static unsigned long | lost_ticks_system = 0 |
| rwlock_t | xtime_lock = RW_LOCK_UNLOCKED |
|
|
Definition at line 123 of file kernel/sched.c. Referenced by schedule(). |
|
|
Definition at line 111 of file kernel/sched.c. Referenced by reschedule_idle(), and reschedule_idle_slow(). |
|
|
Value: \
\
tsk->state = (task_state); \
add_wait_queue(&sem->wait, &wait); \
\
/* \
* Ok, we're set up. sem->count is known to be less than zero \
* so we must wait. \
* \
* We can let go the lock for purposes of waiting. \
* We re-acquire it after awaking so as to protect \
* all semaphore operations. \
* \
* If "up()" is called before we call waking_non_zero() then \
* we will catch it right away. If it is called later then \
* we will have to go through a wakeup cycle to catch it. \
* \
* Multiple waiters contend for the semaphore lock to see \
* who gets to gate through and who has to wait some more. \
*/ \
for (;;) {
Definition at line 991 of file kernel/sched.c. Referenced by __down_interruptible(). |
|
|
Value: tsk->state = (task_state); \ } \ tsk->state = TASK_RUNNING; \ remove_wait_queue(&sem->wait, &wait); Definition at line 1000 of file kernel/sched.c. Referenced by __down_interruptible(). |
|
|
Value: Definition at line 987 of file kernel/sched.c. Referenced by __down_interruptible(). |
|
|
Definition at line 122 of file kernel/sched.c. Referenced by __schedule_tail(), reschedule_idle_slow(), and schedule(). |
|
|
Definition at line 503 of file kernel/sched.c. |
|
|
Value: (((p1)->lock_depth >= 0) && (p2)->lock_depth >= 0) && \
(((p2)->policy == SCHED_OTHER) && ((p1)->avg_slice < cacheflush_time))
Definition at line 243 of file kernel/sched.c. Referenced by merge_maps(), reschedule_idle(), and reschedule_idle_slow(). |
|
|
Value: wait.task = current; \ write_lock_irqsave(&waitqueue_lock,flags); \ __add_wait_queue(p, &wait); \ write_unlock(&waitqueue_lock); Definition at line 1044 of file kernel/sched.c. Referenced by cascade_timers(), interruptible_sleep_on_timeout(), and sleep_on(). |
|
|
Value: write_lock_irq(&waitqueue_lock); \ __remove_wait_queue(p, &wait); \ write_unlock_irqrestore(&waitqueue_lock,flags); Definition at line 1050 of file kernel/sched.c. Referenced by cascade_timers(), interruptible_sleep_on_timeout(), and sleep_on(). |
|
|
Value: Definition at line 1040 of file kernel/sched.c. Referenced by cascade_timers(), interruptible_sleep_on_timeout(), and sleep_on(). |
|
|
Definition at line 474 of file kernel/sched.c. Referenced by internal_add_timer(). |
|
|
Definition at line 478 of file kernel/sched.c. Referenced by internal_add_timer(). |
|
|
Definition at line 476 of file kernel/sched.c. |
|
|
Definition at line 475 of file kernel/sched.c. Referenced by internal_add_timer(). |
|
|
Definition at line 479 of file kernel/sched.c. Referenced by internal_add_timer(). |
|
|
Definition at line 477 of file kernel/sched.c. Referenced by internal_add_timer(). |
|
|
|
|
|
Definition at line 1006 of file kernel/sched.c. |
|
|
Definition at line 1016 of file kernel/sched.c. References DOWN_HEAD, DOWN_TAIL, DOWN_VAR, schedule(), TASK_UNINTERRUPTIBLE, and waking_non_zero. Here is the call graph for this function: ![]() |
|
|
Definition at line 1035 of file kernel/sched.c. |
|
|
Definition at line 667 of file kernel/sched.c. References idle_task, reschedule_idle(), smp_processor_id, TASK_RUNNING, and wmb. Referenced by schedule(), and schedule_tail(). Here is the call graph for this function: ![]() |
|
|
Definition at line 963 of file kernel/sched.c. References semaphore::wait, and wake_one_more. |
|
||||||||||||
|
Definition at line 891 of file kernel/sched.c. References next, NULL, out, p, read_lock, read_unlock, TASK_EXCLUSIVE, and wake_up_process(). Here is the call graph for this function: ![]() |
|
|
|
Definition at line 367 of file kernel/sched.c. References init_task, next, and nr_running. Referenced by wake_up_process(). |
|
|
Definition at line 1218 of file kernel/sched.c. Referenced by timer_bh(). |
|
|
Definition at line 1105 of file kernel/sched.c. References current, schedule_timeout, SLEEP_ON_HEAD, SLEEP_ON_TAIL, SLEEP_ON_VAR, and TASK_UNINTERRUPTIBLE. |
|
|
Definition at line 1202 of file kernel/sched.c. |
|
|
Definition at line 2051 of file kernel/sched.c. Referenced by context_thread(), lockd(), reclaimer(), rtl8139_thread(), usb_hub_thread(), and usb_stor_control_thread(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 378 of file kernel/sched.c. References next, nr_running, and NULL. Referenced by schedule(). |
|