Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
sched.h File Reference
#include <uapi/linux/sched.h>
#include <asm/param.h>
#include <linux/capability.h>
#include <linux/threads.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/timex.h>
#include <linux/jiffies.h>
#include <linux/rbtree.h>
#include <linux/thread_info.h>
#include <linux/cpumask.h>
#include <linux/errno.h>
#include <linux/nodemask.h>
#include <linux/mm_types.h>
#include <asm/page.h>
#include <asm/ptrace.h>
#include <asm/cputime.h>
#include <linux/smp.h>
#include <linux/sem.h>
#include <linux/signal.h>
#include <linux/compiler.h>
#include <linux/completion.h>
#include <linux/pid.h>
#include <linux/percpu.h>
#include <linux/topology.h>
#include <linux/proportions.h>
#include <linux/seccomp.h>
#include <linux/rcupdate.h>
#include <linux/rculist.h>
#include <linux/rtmutex.h>
#include <linux/time.h>
#include <linux/param.h>
#include <linux/resource.h>
#include <linux/timer.h>
#include <linux/hrtimer.h>
#include <linux/task_io_accounting.h>
#include <linux/latencytop.h>
#include <linux/cred.h>
#include <linux/llist.h>
#include <linux/uidgid.h>
#include <asm/processor.h>
#include <linux/spinlock.h>
#include <linux/aio.h>
#include <linux/rwsem.h>
#include <asm/current.h>

Go to the source code of this file.

Data Structures

struct  sched_param
 
struct  sighand_struct
 
struct  pacct_struct
 
struct  cpu_itimer
 
struct  task_cputime
 
struct  thread_group_cputimer
 
struct  signal_struct
 
struct  user_struct
 
struct  sched_class
 
struct  load_weight
 
struct  sched_entity
 
struct  sched_rt_entity
 
struct  task_struct
 
union  thread_union
 

Macros

#define CLONE_KERNEL   (CLONE_FS | CLONE_FILES | CLONE_SIGHAND)
 
#define FSHIFT   11 /* nr of bits of precision */
 
#define FIXED_1   (1<<FSHIFT) /* 1.0 as fixed-point */
 
#define LOAD_FREQ   (5*HZ+1) /* 5 sec intervals */
 
#define EXP_1   1884 /* 1/exp(5sec/1min) as fixed-point */
 
#define EXP_5   2014 /* 1/exp(5sec/5min) */
 
#define EXP_15   2037 /* 1/exp(5sec/15min) */
 
#define CALC_LOAD(load, exp, n)
 
#define TASK_RUNNING   0
 
#define TASK_INTERRUPTIBLE   1
 
#define TASK_UNINTERRUPTIBLE   2
 
#define __TASK_STOPPED   4
 
#define __TASK_TRACED   8
 
#define EXIT_ZOMBIE   16
 
#define EXIT_DEAD   32
 
#define TASK_DEAD   64
 
#define TASK_WAKEKILL   128
 
#define TASK_WAKING   256
 
#define TASK_STATE_MAX   512
 
#define TASK_STATE_TO_CHAR_STR   "RSDTtZXxKW"
 
#define TASK_KILLABLE   (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)
 
#define TASK_STOPPED   (TASK_WAKEKILL | __TASK_STOPPED)
 
#define TASK_TRACED   (TASK_WAKEKILL | __TASK_TRACED)
 
#define TASK_NORMAL   (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
 
#define TASK_ALL   (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED)
 
#define TASK_REPORT
 
#define task_is_traced(task)   ((task->state & __TASK_TRACED) != 0)
 
#define task_is_stopped(task)   ((task->state & __TASK_STOPPED) != 0)
 
#define task_is_dead(task)   ((task)->exit_state != 0)
 
#define task_is_stopped_or_traced(task)   ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
 
#define task_contributes_to_load(task)
 
#define __set_task_state(tsk, state_value)   do { (tsk)->state = (state_value); } while (0)
 
#define set_task_state(tsk, state_value)   set_mb((tsk)->state, (state_value))
 
#define __set_current_state(state_value)   do { current->state = (state_value); } while (0)
 
#define set_current_state(state_value)   set_mb(current->state, (state_value))
 
#define TASK_COMM_LEN   16
 
#define __sched   __attribute__((__section__(".sched.text")))
 
#define MAX_SCHEDULE_TIMEOUT   LONG_MAX
 
#define MAPCOUNT_ELF_CORE_MARGIN   (5)
 
#define DEFAULT_MAX_MAP_COUNT   (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN)
 
#define SUID_DUMPABLE_DISABLED   0
 
#define SUID_DUMPABLE_ENABLED   1
 
#define SUID_DUMPABLE_SAFE   2
 
#define MMF_DUMPABLE   0 /* core dump is permitted */
 
#define MMF_DUMP_SECURELY   1 /* core file is readable only by root */
 
#define MMF_DUMPABLE_BITS   2
 
#define MMF_DUMPABLE_MASK   ((1 << MMF_DUMPABLE_BITS) - 1)
 
#define MMF_DUMP_ANON_PRIVATE   2
 
#define MMF_DUMP_ANON_SHARED   3
 
#define MMF_DUMP_MAPPED_PRIVATE   4
 
#define MMF_DUMP_MAPPED_SHARED   5
 
#define MMF_DUMP_ELF_HEADERS   6
 
#define MMF_DUMP_HUGETLB_PRIVATE   7
 
#define MMF_DUMP_HUGETLB_SHARED   8
 
#define MMF_DUMP_FILTER_SHIFT   MMF_DUMPABLE_BITS
 
#define MMF_DUMP_FILTER_BITS   7
 
#define MMF_DUMP_FILTER_MASK   (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT)
 
#define MMF_DUMP_FILTER_DEFAULT
 
#define MMF_DUMP_MASK_DEFAULT_ELF   0
 
#define MMF_VM_MERGEABLE   16 /* KSM may merge identical pages */
 
#define MMF_VM_HUGEPAGE   17 /* set when VM_HUGEPAGE is set on vma */
 
#define MMF_EXE_FILE_CHANGED   18 /* see prctl_set_mm_exe_file() */
 
#define MMF_HAS_UPROBES   19 /* has uprobes */
 
#define MMF_RECALC_UPROBES   20 /* MMF_HAS_UPROBES can be wrong */
 
#define MMF_INIT_MASK   (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK)
 
#define prof_exp   stime
 
#define virt_exp   utime
 
#define sched_exp   sum_exec_runtime
 
#define INIT_CPUTIME
 
#define INIT_PREEMPT_COUNT   (1 + PREEMPT_ACTIVE)
 
#define SIGNAL_STOP_STOPPED   0x00000001 /* job control stop in effect */
 
#define SIGNAL_STOP_CONTINUED   0x00000002 /* SIGCONT since WCONTINUED reap */
 
#define SIGNAL_GROUP_EXIT   0x00000004 /* group exit in progress */
 
#define SIGNAL_CLD_STOPPED   0x00000010
 
#define SIGNAL_CLD_CONTINUED   0x00000020
 
#define SIGNAL_CLD_MASK   (SIGNAL_CLD_STOPPED|SIGNAL_CLD_CONTINUED)
 
#define SIGNAL_UNKILLABLE   0x00000040 /* for init: ignore fatal signals */
 
#define INIT_USER   (&root_user)
 
#define SCHED_LOAD_RESOLUTION   0
 
#define scale_load(w)   (w)
 
#define scale_load_down(w)   (w)
 
#define SCHED_LOAD_SHIFT   (10 + SCHED_LOAD_RESOLUTION)
 
#define SCHED_LOAD_SCALE   (1L << SCHED_LOAD_SHIFT)
 
#define SCHED_POWER_SHIFT   10
 
#define SCHED_POWER_SCALE   (1L << SCHED_POWER_SHIFT)
 
#define WF_SYNC   0x01 /* waker goes to sleep after wakup */
 
#define WF_FORK   0x02 /* child wakeup after fork */
 
#define WF_MIGRATED   0x04 /* internal use, task got migrated */
 
#define ENQUEUE_WAKEUP   1
 
#define ENQUEUE_HEAD   2
 
#define ENQUEUE_WAKING   0
 
#define DEQUEUE_SLEEP   1
 
#define RR_TIMESLICE   (100 * HZ / 1000)
 
#define tsk_cpus_allowed(tsk)   (&(tsk)->cpus_allowed)
 
#define MAX_USER_RT_PRIO   100
 
#define MAX_RT_PRIO   MAX_USER_RT_PRIO
 
#define MAX_PRIO   (MAX_RT_PRIO + 40)
 
#define DEFAULT_PRIO   (MAX_RT_PRIO + 20)
 
#define get_task_struct(tsk)   do { atomic_inc(&(tsk)->usage); } while(0)
 
#define PF_EXITING   0x00000004 /* getting shut down */
 
#define PF_EXITPIDONE   0x00000008 /* pi exit done on shut down */
 
#define PF_VCPU   0x00000010 /* I'm a virtual CPU */
 
#define PF_WQ_WORKER   0x00000020 /* I'm a workqueue worker */
 
#define PF_FORKNOEXEC   0x00000040 /* forked but didn't exec */
 
#define PF_MCE_PROCESS   0x00000080 /* process policy on mce errors */
 
#define PF_SUPERPRIV   0x00000100 /* used super-user privileges */
 
#define PF_DUMPCORE   0x00000200 /* dumped core */
 
#define PF_SIGNALED   0x00000400 /* killed by a signal */
 
#define PF_MEMALLOC   0x00000800 /* Allocating memory */
 
#define PF_NPROC_EXCEEDED   0x00001000 /* set_user noticed that RLIMIT_NPROC was exceeded */
 
#define PF_USED_MATH   0x00002000 /* if unset the fpu must be initialized before use */
 
#define PF_NOFREEZE   0x00008000 /* this thread should not be frozen */
 
#define PF_FROZEN   0x00010000 /* frozen for system suspend */
 
#define PF_FSTRANS   0x00020000 /* inside a filesystem transaction */
 
#define PF_KSWAPD   0x00040000 /* I am kswapd */
 
#define PF_LESS_THROTTLE   0x00100000 /* Throttle me less: I clean memory */
 
#define PF_KTHREAD   0x00200000 /* I am a kernel thread */
 
#define PF_RANDOMIZE   0x00400000 /* randomize virtual address space */
 
#define PF_SWAPWRITE   0x00800000 /* Allowed to write to swap */
 
#define PF_SPREAD_PAGE   0x01000000 /* Spread page cache over cpuset */
 
#define PF_SPREAD_SLAB   0x02000000 /* Spread some slab caches over cpuset */
 
#define PF_THREAD_BOUND   0x04000000 /* Thread bound to specific cpu */
 
#define PF_MCE_EARLY   0x08000000 /* Early kill for mce process policy */
 
#define PF_MEMPOLICY   0x10000000 /* Non-default NUMA mempolicy */
 
#define PF_MUTEX_TESTER   0x20000000 /* Thread belongs to the rt mutex tester */
 
#define PF_FREEZER_SKIP   0x40000000 /* Freezer should not count it as freezable */
 
#define clear_stopped_child_used_math(child)   do { (child)->flags &= ~PF_USED_MATH; } while (0)
 
#define set_stopped_child_used_math(child)   do { (child)->flags |= PF_USED_MATH; } while (0)
 
#define clear_used_math()   clear_stopped_child_used_math(current)
 
#define set_used_math()   set_stopped_child_used_math(current)
 
#define conditional_stopped_child_used_math(condition, child)   do { (child)->flags &= ~PF_USED_MATH, (child)->flags |= (condition) ? PF_USED_MATH : 0; } while (0)
 
#define conditional_used_math(condition)   conditional_stopped_child_used_math(condition, current)
 
#define copy_to_stopped_child_used_math(child)   do { (child)->flags &= ~PF_USED_MATH, (child)->flags |= current->flags & PF_USED_MATH; } while (0)
 
#define tsk_used_math(p)   ((p)->flags & PF_USED_MATH)
 
#define used_math()   tsk_used_math(current)
 
#define JOBCTL_STOP_SIGMASK   0xffff /* signr of the last group stop */
 
#define JOBCTL_STOP_DEQUEUED_BIT   16 /* stop signal dequeued */
 
#define JOBCTL_STOP_PENDING_BIT   17 /* task should stop for group stop */
 
#define JOBCTL_STOP_CONSUME_BIT   18 /* consume group stop count */
 
#define JOBCTL_TRAP_STOP_BIT   19 /* trap for STOP */
 
#define JOBCTL_TRAP_NOTIFY_BIT   20 /* trap for NOTIFY */
 
#define JOBCTL_TRAPPING_BIT   21 /* switching to TRACED */
 
#define JOBCTL_LISTENING_BIT   22 /* ptracer is listening for events */
 
#define JOBCTL_STOP_DEQUEUED   (1 << JOBCTL_STOP_DEQUEUED_BIT)
 
#define JOBCTL_STOP_PENDING   (1 << JOBCTL_STOP_PENDING_BIT)
 
#define JOBCTL_STOP_CONSUME   (1 << JOBCTL_STOP_CONSUME_BIT)
 
#define JOBCTL_TRAP_STOP   (1 << JOBCTL_TRAP_STOP_BIT)
 
#define JOBCTL_TRAP_NOTIFY   (1 << JOBCTL_TRAP_NOTIFY_BIT)
 
#define JOBCTL_TRAPPING   (1 << JOBCTL_TRAPPING_BIT)
 
#define JOBCTL_LISTENING   (1 << JOBCTL_LISTENING_BIT)
 
#define JOBCTL_TRAP_MASK   (JOBCTL_TRAP_STOP | JOBCTL_TRAP_NOTIFY)
 
#define JOBCTL_PENDING_MASK   (JOBCTL_STOP_PENDING | JOBCTL_TRAP_MASK)
 
#define sched_exec()   {}
 
#define rt_mutex_adjust_pi(p)   do { } while (0)
 
#define SEND_SIG_NOINFO   ((struct siginfo *) 0)
 
#define SEND_SIG_PRIV   ((struct siginfo *) 1)
 
#define SEND_SIG_FORCED   ((struct siginfo *) 2)
 
#define next_task(p)   list_entry_rcu((p)->tasks.next, struct task_struct, tasks)
 
#define for_each_process(p)   for (p = &init_task ; (p = next_task(p)) != &init_task ; )
 
#define do_each_thread(g, t)   for (g = t = &init_task ; (g = t = next_task(g)) != &init_task ; ) do
 
#define while_each_thread(g, t)   while ((t = next_thread(t)) != g)
 
#define delay_group_leader(p)   (thread_group_leader(p) && !thread_group_empty(p))
 
#define task_thread_info(task)   ((struct thread_info *)(task)->stack)
 
#define task_stack_page(task)   ((task)->stack)
 
#define cond_resched()
 
#define PREEMPT_LOCK_OFFSET   0
 
#define cond_resched_lock(lock)
 
#define cond_resched_softirq()
 
#define TASK_SIZE_OF(tsk)   TASK_SIZE
 

Enumerations

enum  { sysctl_hung_task_timeout_secs = 0 }
 
enum  cpu_idle_type { CPU_IDLE, CPU_NOT_IDLE, CPU_NEWLY_IDLE, CPU_MAX_IDLE_TYPES }
 
enum  perf_event_task_context { perf_invalid_context = -1, perf_hw_context = 0, perf_sw_context, perf_nr_task_contexts }
 
enum  sched_tunable_scaling { SCHED_TUNABLESCALING_NONE, SCHED_TUNABLESCALING_LOG, SCHED_TUNABLESCALING_LINEAR, SCHED_TUNABLESCALING_END }
 

Functions

void get_avenrun (unsigned long *loads, unsigned long offset, int shift)
 
 DECLARE_PER_CPU (unsigned long, process_counts)
 
int nr_processes (void)
 
unsigned long nr_running (void)
 
unsigned long nr_uninterruptible (void)
 
unsigned long nr_iowait (void)
 
unsigned long nr_iowait_cpu (int cpu)
 
unsigned long this_cpu_load (void)
 
void calc_global_load (unsigned long ticks)
 
void update_cpu_load_nohz (void)
 
unsigned long get_parent_ip (unsigned long addr)
 
void sched_init (void)
 
void sched_init_smp (void)
 
asmlinkage void schedule_tail (struct task_struct *prev)
 
void init_idle (struct task_struct *idle, int cpu)
 
void init_idle_bootup_task (struct task_struct *idle)
 
int runqueue_is_locked (int cpu)
 
void show_state_filter (unsigned long state_filter)
 
void show_regs (struct pt_regs *)
 
void show_stack (struct task_struct *task, unsigned long *sp)
 
void io_schedule (void)
 
long io_schedule_timeout (long timeout)
 
void cpu_init (void)
 
void trap_init (void)
 
void update_process_times (int user)
 
void scheduler_tick (void)
 
void sched_show_task (struct task_struct *p)
 
int in_sched_functions (unsigned long addr)
 
signed long schedule_timeout (signed long timeout)
 
signed long schedule_timeout_interruptible (signed long timeout)
 
signed long schedule_timeout_killable (signed long timeout)
 
signed long schedule_timeout_uninterruptible (signed long timeout)
 
asmlinkage void schedule (void)
 
void schedule_preempt_disabled (void)
 
int mutex_spin_on_owner (struct mutex *lock, struct task_struct *owner)
 
void set_dumpable (struct mm_struct *mm, int value)
 
int get_dumpable (struct mm_struct *mm)
 
int uids_sysfs_init (void)
 
struct user_structfind_user (kuid_t)
 
pid_t __task_pid_nr_ns (struct task_struct *task, enum pid_type type, struct pid_namespace *ns)
 
pid_t task_tgid_nr_ns (struct task_struct *tsk, struct pid_namespace *ns)
 
int is_container_init (struct task_struct *tsk)
 
void free_task (struct task_struct *tsk)
 
void __put_task_struct (struct task_struct *t)
 
void task_times (struct task_struct *p, cputime_t *ut, cputime_t *st)
 
void thread_group_times (struct task_struct *p, cputime_t *ut, cputime_t *st)
 
bool task_set_jobctl_pending (struct task_struct *task, unsigned int mask)
 
void task_clear_jobctl_trapping (struct task_struct *task)
 
void task_clear_jobctl_pending (struct task_struct *task, unsigned int mask)
 
unsigned long long notrace sched_clock (void)
 
u64 cpu_clock (int cpu)
 
u64 local_clock (void)
 
u64 sched_clock_cpu (int cpu)
 
void sched_clock_init (void)
 
unsigned long long task_sched_runtime (struct task_struct *task)
 
int sched_rt_handler (struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
 
bool yield_to (struct task_struct *p, bool preempt)
 
void set_user_nice (struct task_struct *p, long nice)
 
int task_prio (const struct task_struct *p)
 
int task_nice (const struct task_struct *p)
 
int can_nice (const struct task_struct *p, const int nice)
 
int task_curr (const struct task_struct *p)
 
int idle_cpu (int cpu)
 
int sched_setscheduler (struct task_struct *, int, const struct sched_param *)
 
int sched_setscheduler_nocheck (struct task_struct *, int, const struct sched_param *)
 
struct task_structidle_task (int cpu)
 
struct task_structcurr_task (int cpu)
 
void set_curr_task (int cpu, struct task_struct *p)
 
void yield (void)
 
struct task_structfind_task_by_vpid (pid_t nr)
 
struct task_structfind_task_by_pid_ns (pid_t nr, struct pid_namespace *ns)
 
void __set_special_pids (struct pid *pid)
 
struct user_structalloc_uid (kuid_t)
 
void free_uid (struct user_struct *)
 
void xtime_update (unsigned long ticks)
 
int wake_up_state (struct task_struct *tsk, unsigned int state)
 
int wake_up_process (struct task_struct *tsk)
 
void wake_up_new_task (struct task_struct *tsk)
 
void sched_fork (struct task_struct *p)
 
void sched_dead (struct task_struct *p)
 
void proc_caches_init (void)
 
void flush_signals (struct task_struct *)
 
void __flush_signals (struct task_struct *)
 
void ignore_signals (struct task_struct *)
 
void flush_signal_handlers (struct task_struct *, int force_default)
 
int dequeue_signal (struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
 
void block_all_signals (int(*notifier)(void *priv), void *priv, sigset_t *mask)
 
void unblock_all_signals (void)
 
void release_task (struct task_struct *p)
 
int send_sig_info (int, struct siginfo *, struct task_struct *)
 
int force_sigsegv (int, struct task_struct *)
 
int force_sig_info (int, struct siginfo *, struct task_struct *)
 
int __kill_pgrp_info (int sig, struct siginfo *info, struct pid *pgrp)
 
int kill_pid_info (int sig, struct siginfo *info, struct pid *pid)
 
int kill_pid_info_as_cred (int, struct siginfo *, struct pid *, const struct cred *, u32)
 
int kill_pgrp (struct pid *pid, int sig, int priv)
 
int kill_pid (struct pid *pid, int sig, int priv)
 
int kill_proc_info (int, struct siginfo *, pid_t)
 
__must_check bool do_notify_parent (struct task_struct *, int)
 
void __wake_up_parent (struct task_struct *p, struct task_struct *parent)
 
void force_sig (int, struct task_struct *)
 
int send_sig (int, struct task_struct *, int)
 
int zap_other_threads (struct task_struct *p)
 
struct sigqueuesigqueue_alloc (void)
 
void sigqueue_free (struct sigqueue *)
 
int send_sigqueue (struct sigqueue *, struct task_struct *, int group)
 
int do_sigaction (int, struct k_sigaction *, struct k_sigaction *)
 
int do_sigaltstack (const stack_t __user *, stack_t __user *, unsigned long)
 
struct mm_structmm_alloc (void)
 
void __mmdrop (struct mm_struct *)
 
void mmput (struct mm_struct *)
 
struct mm_structget_task_mm (struct task_struct *task)
 
struct mm_structmm_access (struct task_struct *task, unsigned int mode)
 
void mm_release (struct task_struct *, struct mm_struct *)
 
struct mm_structdup_mm (struct task_struct *tsk)
 
int copy_thread (unsigned long, unsigned long, unsigned long, struct task_struct *, struct pt_regs *)
 
void flush_thread (void)
 
void exit_thread (void)
 
void exit_files (struct task_struct *)
 
void __cleanup_sighand (struct sighand_struct *)
 
void exit_itimers (struct signal_struct *)
 
void flush_itimer_signals (void)
 
void do_group_exit (int)
 
void daemonize (const char *,...)
 
int allow_signal (int)
 
int disallow_signal (int)
 
int do_execve (const char *, const char __user *const __user *, const char __user *const __user *, struct pt_regs *)
 
long do_fork (unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *)
 
struct task_structfork_idle (int)
 
void set_task_comm (struct task_struct *tsk, char *from)
 
charget_task_comm (char *to, struct task_struct *tsk)
 
bool current_is_single_threaded (void)
 
struct sighand_struct__lock_task_sighand (struct task_struct *tsk, unsigned long *flags)
 
void thread_info_cache_init (void)
 
int _cond_resched (void)
 
int __cond_resched_lock (spinlock_t *lock)
 
int __cond_resched_softirq (void)
 
void thread_group_cputime (struct task_struct *tsk, struct task_cputime *times)
 
void thread_group_cputimer (struct task_struct *tsk, struct task_cputime *times)
 
void recalc_sigpending_and_wake (struct task_struct *t)
 
void recalc_sigpending (void)
 
void signal_wake_up (struct task_struct *t, int resume_stopped)
 
long sched_setaffinity (pid_t pid, const struct cpumask *new_mask)
 
long sched_getaffinity (pid_t pid, struct cpumask *mask)
 
void normalize_rt_tasks (void)
 
int task_can_switch_user (struct user_struct *up, struct task_struct *tsk)
 

Variables

unsigned long avenrun []
 
unsigned long total_forks
 
int nr_threads
 
char ___assert_task_state [1-2 *!!(sizeof(TASK_STATE_TO_CHAR_STR)-1!=ilog2(TASK_STATE_MAX)+1)]
 
rwlock_t tasklist_lock
 
spinlock_t mmlist_lock
 
char __sched_text_start []
 
char __sched_text_end []
 
int sysctl_max_map_count
 
struct user_struct root_user
 
struct pidcad_pid
 
unsigned int sysctl_sched_latency
 
unsigned int sysctl_sched_min_granularity
 
unsigned int sysctl_sched_wakeup_granularity
 
unsigned int sysctl_sched_child_runs_first
 
enum sched_tunable_scaling sysctl_sched_tunable_scaling
 
unsigned int sysctl_sched_rt_period
 
int sysctl_sched_rt_runtime
 
struct exec_domain default_exec_domain
 
union thread_union init_thread_union
 
struct task_struct init_task
 
struct mm_struct init_mm
 
struct pid_namespace init_pid_ns
 

Macro Definition Documentation

#define __sched   __attribute__((__section__(".sched.text")))

Definition at line 311 of file sched.h.

#define __set_current_state (   state_value)    do { current->state = (state_value); } while (0)

Definition at line 202 of file sched.h.

#define __set_task_state (   tsk,
  state_value 
)    do { (tsk)->state = (state_value); } while (0)

Definition at line 186 of file sched.h.

#define __TASK_STOPPED   4

Definition at line 147 of file sched.h.

#define __TASK_TRACED   8

Definition at line 148 of file sched.h.

#define CALC_LOAD (   load,
  exp,
  n 
)
Value:
load *= exp; \
load += n*(FIXED_1-exp); \
load >>= FSHIFT;

Definition at line 91 of file sched.h.

#define clear_stopped_child_used_math (   child)    do { (child)->flags &= ~PF_USED_MATH; } while (0)

Definition at line 1777 of file sched.h.

#define clear_used_math ( )    clear_stopped_child_used_math(current)

Definition at line 1779 of file sched.h.

#define CLONE_KERNEL   (CLONE_FS | CLONE_FILES | CLONE_SIGHAND)

Definition at line 69 of file sched.h.

#define cond_resched ( )
Value:
({ \
__might_sleep(__FILE__, __LINE__, 0); \
_cond_resched(); \
})

Definition at line 2598 of file sched.h.

#define cond_resched_lock (   lock)
Value:
({ \
__might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET); \
__cond_resched_lock(lock); \
})

Definition at line 2611 of file sched.h.

#define cond_resched_softirq ( )
Value:
({ \
__might_sleep(__FILE__, __LINE__, SOFTIRQ_DISABLE_OFFSET); \
__cond_resched_softirq(); \
})

Definition at line 2618 of file sched.h.

#define conditional_stopped_child_used_math (   condition,
  child 
)    do { (child)->flags &= ~PF_USED_MATH, (child)->flags |= (condition) ? PF_USED_MATH : 0; } while (0)

Definition at line 1781 of file sched.h.

#define conditional_used_math (   condition)    conditional_stopped_child_used_math(condition, current)

Definition at line 1783 of file sched.h.

#define copy_to_stopped_child_used_math (   child)    do { (child)->flags &= ~PF_USED_MATH, (child)->flags |= current->flags & PF_USED_MATH; } while (0)

Definition at line 1785 of file sched.h.

#define DEFAULT_MAX_MAP_COUNT   (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN)

Definition at line 344 of file sched.h.

#define DEFAULT_PRIO   (MAX_RT_PRIO + 20)

Definition at line 1573 of file sched.h.

#define delay_group_leader (   p)    (thread_group_leader(p) && !thread_group_empty(p))

Definition at line 2370 of file sched.h.

#define DEQUEUE_SLEEP   1

Definition at line 1047 of file sched.h.

#define do_each_thread (   g,
  t 
)    for (g = t = &init_task ; (g = t = next_task(g)) != &init_task ; ) do

Definition at line 2326 of file sched.h.

#define ENQUEUE_HEAD   2

Definition at line 1040 of file sched.h.

#define ENQUEUE_WAKEUP   1

Definition at line 1039 of file sched.h.

#define ENQUEUE_WAKING   0

Definition at line 1044 of file sched.h.

#define EXIT_DEAD   32

Definition at line 151 of file sched.h.

#define EXIT_ZOMBIE   16

Definition at line 150 of file sched.h.

#define EXP_1   1884 /* 1/exp(5sec/1min) as fixed-point */

Definition at line 87 of file sched.h.

#define EXP_15   2037 /* 1/exp(5sec/15min) */

Definition at line 89 of file sched.h.

#define EXP_5   2014 /* 1/exp(5sec/5min) */

Definition at line 88 of file sched.h.

#define FIXED_1   (1<<FSHIFT) /* 1.0 as fixed-point */

Definition at line 85 of file sched.h.

#define for_each_process (   p)    for (p = &init_task ; (p = next_task(p)) != &init_task ; )

Definition at line 2317 of file sched.h.

#define FSHIFT   11 /* nr of bits of precision */

Definition at line 84 of file sched.h.

#define get_task_struct (   tsk)    do { atomic_inc(&(tsk)->usage); } while(0)

Definition at line 1722 of file sched.h.

#define INIT_CPUTIME
Value:
(struct task_cputime) { \
.utime = 0, \
.stime = 0, \
.sum_exec_runtime = 0, \
}

Definition at line 457 of file sched.h.

#define INIT_PREEMPT_COUNT   (1 + PREEMPT_ACTIVE)

Definition at line 471 of file sched.h.

#define INIT_USER   (&root_user)

Definition at line 708 of file sched.h.

#define JOBCTL_LISTENING   (1 << JOBCTL_LISTENING_BIT)

Definition at line 1810 of file sched.h.

#define JOBCTL_LISTENING_BIT   22 /* ptracer is listening for events */

Definition at line 1802 of file sched.h.

#define JOBCTL_PENDING_MASK   (JOBCTL_STOP_PENDING | JOBCTL_TRAP_MASK)

Definition at line 1813 of file sched.h.

#define JOBCTL_STOP_CONSUME   (1 << JOBCTL_STOP_CONSUME_BIT)

Definition at line 1806 of file sched.h.

#define JOBCTL_STOP_CONSUME_BIT   18 /* consume group stop count */

Definition at line 1798 of file sched.h.

#define JOBCTL_STOP_DEQUEUED   (1 << JOBCTL_STOP_DEQUEUED_BIT)

Definition at line 1804 of file sched.h.

#define JOBCTL_STOP_DEQUEUED_BIT   16 /* stop signal dequeued */

Definition at line 1796 of file sched.h.

#define JOBCTL_STOP_PENDING   (1 << JOBCTL_STOP_PENDING_BIT)

Definition at line 1805 of file sched.h.

#define JOBCTL_STOP_PENDING_BIT   17 /* task should stop for group stop */

Definition at line 1797 of file sched.h.

#define JOBCTL_STOP_SIGMASK   0xffff /* signr of the last group stop */

Definition at line 1794 of file sched.h.

#define JOBCTL_TRAP_MASK   (JOBCTL_TRAP_STOP | JOBCTL_TRAP_NOTIFY)

Definition at line 1812 of file sched.h.

#define JOBCTL_TRAP_NOTIFY   (1 << JOBCTL_TRAP_NOTIFY_BIT)

Definition at line 1808 of file sched.h.

#define JOBCTL_TRAP_NOTIFY_BIT   20 /* trap for NOTIFY */

Definition at line 1800 of file sched.h.

#define JOBCTL_TRAP_STOP   (1 << JOBCTL_TRAP_STOP_BIT)

Definition at line 1807 of file sched.h.

#define JOBCTL_TRAP_STOP_BIT   19 /* trap for STOP */

Definition at line 1799 of file sched.h.

#define JOBCTL_TRAPPING   (1 << JOBCTL_TRAPPING_BIT)

Definition at line 1809 of file sched.h.

#define JOBCTL_TRAPPING_BIT   21 /* switching to TRACED */

Definition at line 1801 of file sched.h.

#define LOAD_FREQ   (5*HZ+1) /* 5 sec intervals */

Definition at line 86 of file sched.h.

#define MAPCOUNT_ELF_CORE_MARGIN   (5)

Definition at line 343 of file sched.h.

#define MAX_PRIO   (MAX_RT_PRIO + 40)

Definition at line 1572 of file sched.h.

#define MAX_RT_PRIO   MAX_USER_RT_PRIO

Definition at line 1570 of file sched.h.

#define MAX_SCHEDULE_TIMEOUT   LONG_MAX

Definition at line 319 of file sched.h.

#define MAX_USER_RT_PRIO   100

Definition at line 1569 of file sched.h.

#define MMF_DUMP_ANON_PRIVATE   2

Definition at line 383 of file sched.h.

#define MMF_DUMP_ANON_SHARED   3

Definition at line 384 of file sched.h.

#define MMF_DUMP_ELF_HEADERS   6

Definition at line 387 of file sched.h.

#define MMF_DUMP_FILTER_BITS   7

Definition at line 392 of file sched.h.

#define MMF_DUMP_FILTER_DEFAULT
Value:

Definition at line 395 of file sched.h.

#define MMF_DUMP_FILTER_MASK   (((1 << MMF_DUMP_FILTER_BITS) - 1) << MMF_DUMP_FILTER_SHIFT)

Definition at line 393 of file sched.h.

#define MMF_DUMP_FILTER_SHIFT   MMF_DUMPABLE_BITS

Definition at line 391 of file sched.h.

#define MMF_DUMP_HUGETLB_PRIVATE   7

Definition at line 388 of file sched.h.

#define MMF_DUMP_HUGETLB_SHARED   8

Definition at line 389 of file sched.h.

#define MMF_DUMP_MAPPED_PRIVATE   4

Definition at line 385 of file sched.h.

#define MMF_DUMP_MAPPED_SHARED   5

Definition at line 386 of file sched.h.

#define MMF_DUMP_MASK_DEFAULT_ELF   0

Definition at line 402 of file sched.h.

#define MMF_DUMP_SECURELY   1 /* core file is readable only by root */

Definition at line 377 of file sched.h.

#define MMF_DUMPABLE   0 /* core dump is permitted */

Definition at line 376 of file sched.h.

#define MMF_DUMPABLE_BITS   2

Definition at line 379 of file sched.h.

#define MMF_DUMPABLE_MASK   ((1 << MMF_DUMPABLE_BITS) - 1)

Definition at line 380 of file sched.h.

#define MMF_EXE_FILE_CHANGED   18 /* see prctl_set_mm_exe_file() */

Definition at line 407 of file sched.h.

#define MMF_HAS_UPROBES   19 /* has uprobes */

Definition at line 409 of file sched.h.

#define MMF_INIT_MASK   (MMF_DUMPABLE_MASK | MMF_DUMP_FILTER_MASK)

Definition at line 412 of file sched.h.

#define MMF_RECALC_UPROBES   20 /* MMF_HAS_UPROBES can be wrong */

Definition at line 410 of file sched.h.

#define MMF_VM_HUGEPAGE   17 /* set when VM_HUGEPAGE is set on vma */

Definition at line 406 of file sched.h.

#define MMF_VM_MERGEABLE   16 /* KSM may merge identical pages */

Definition at line 405 of file sched.h.

#define next_task (   p)    list_entry_rcu((p)->tasks.next, struct task_struct, tasks)

Definition at line 2314 of file sched.h.

#define PF_DUMPCORE   0x00000200 /* dumped core */

Definition at line 1745 of file sched.h.

#define PF_EXITING   0x00000004 /* getting shut down */

Definition at line 1738 of file sched.h.

#define PF_EXITPIDONE   0x00000008 /* pi exit done on shut down */

Definition at line 1739 of file sched.h.

#define PF_FORKNOEXEC   0x00000040 /* forked but didn't exec */

Definition at line 1742 of file sched.h.

#define PF_FREEZER_SKIP   0x40000000 /* Freezer should not count it as freezable */

Definition at line 1764 of file sched.h.

#define PF_FROZEN   0x00010000 /* frozen for system suspend */

Definition at line 1751 of file sched.h.

#define PF_FSTRANS   0x00020000 /* inside a filesystem transaction */

Definition at line 1752 of file sched.h.

#define PF_KSWAPD   0x00040000 /* I am kswapd */

Definition at line 1753 of file sched.h.

#define PF_KTHREAD   0x00200000 /* I am a kernel thread */

Definition at line 1755 of file sched.h.

#define PF_LESS_THROTTLE   0x00100000 /* Throttle me less: I clean memory */

Definition at line 1754 of file sched.h.

#define PF_MCE_EARLY   0x08000000 /* Early kill for mce process policy */

Definition at line 1761 of file sched.h.

#define PF_MCE_PROCESS   0x00000080 /* process policy on mce errors */

Definition at line 1743 of file sched.h.

#define PF_MEMALLOC   0x00000800 /* Allocating memory */

Definition at line 1747 of file sched.h.

#define PF_MEMPOLICY   0x10000000 /* Non-default NUMA mempolicy */

Definition at line 1762 of file sched.h.

#define PF_MUTEX_TESTER   0x20000000 /* Thread belongs to the rt mutex tester */

Definition at line 1763 of file sched.h.

#define PF_NOFREEZE   0x00008000 /* this thread should not be frozen */

Definition at line 1750 of file sched.h.

#define PF_NPROC_EXCEEDED   0x00001000 /* set_user noticed that RLIMIT_NPROC was exceeded */

Definition at line 1748 of file sched.h.

#define PF_RANDOMIZE   0x00400000 /* randomize virtual address space */

Definition at line 1756 of file sched.h.

#define PF_SIGNALED   0x00000400 /* killed by a signal */

Definition at line 1746 of file sched.h.

#define PF_SPREAD_PAGE   0x01000000 /* Spread page cache over cpuset */

Definition at line 1758 of file sched.h.

#define PF_SPREAD_SLAB   0x02000000 /* Spread some slab caches over cpuset */

Definition at line 1759 of file sched.h.

#define PF_SUPERPRIV   0x00000100 /* used super-user privileges */

Definition at line 1744 of file sched.h.

#define PF_SWAPWRITE   0x00800000 /* Allowed to write to swap */

Definition at line 1757 of file sched.h.

#define PF_THREAD_BOUND   0x04000000 /* Thread bound to specific cpu */

Definition at line 1760 of file sched.h.

#define PF_USED_MATH   0x00002000 /* if unset the fpu must be initialized before use */

Definition at line 1749 of file sched.h.

#define PF_VCPU   0x00000010 /* I'm a virtual CPU */

Definition at line 1740 of file sched.h.

#define PF_WQ_WORKER   0x00000020 /* I'm a workqueue worker */

Definition at line 1741 of file sched.h.

#define PREEMPT_LOCK_OFFSET   0

Definition at line 2608 of file sched.h.

#define prof_exp   stime

Definition at line 453 of file sched.h.

#define RR_TIMESLICE   (100 * HZ / 1000)

Definition at line 1179 of file sched.h.

#define rt_mutex_adjust_pi (   p)    do { } while (0)

Definition at line 2057 of file sched.h.

#define scale_load (   w)    (w)

Definition at line 797 of file sched.h.

#define scale_load_down (   w)    (w)

Definition at line 798 of file sched.h.

#define sched_exec ( )    {}

Definition at line 1962 of file sched.h.

#define sched_exp   sum_exec_runtime

Definition at line 455 of file sched.h.

#define SCHED_LOAD_RESOLUTION   0

Definition at line 796 of file sched.h.

#define SCHED_LOAD_SCALE   (1L << SCHED_LOAD_SHIFT)

Definition at line 802 of file sched.h.

#define SCHED_LOAD_SHIFT   (10 + SCHED_LOAD_RESOLUTION)

Definition at line 801 of file sched.h.

#define SCHED_POWER_SCALE   (1L << SCHED_POWER_SHIFT)

Definition at line 808 of file sched.h.

#define SCHED_POWER_SHIFT   10

Definition at line 807 of file sched.h.

#define SEND_SIG_FORCED   ((struct siginfo *) 2)

Definition at line 2223 of file sched.h.

#define SEND_SIG_NOINFO   ((struct siginfo *) 0)

Definition at line 2221 of file sched.h.

#define SEND_SIG_PRIV   ((struct siginfo *) 1)

Definition at line 2222 of file sched.h.

#define set_current_state (   state_value)    set_mb(current->state, (state_value))

Definition at line 204 of file sched.h.

#define set_stopped_child_used_math (   child)    do { (child)->flags |= PF_USED_MATH; } while (0)

Definition at line 1778 of file sched.h.

#define set_task_state (   tsk,
  state_value 
)    set_mb((tsk)->state, (state_value))

Definition at line 188 of file sched.h.

#define set_used_math ( )    set_stopped_child_used_math(current)

Definition at line 1780 of file sched.h.

#define SIGNAL_CLD_CONTINUED   0x00000020

Definition at line 653 of file sched.h.

#define SIGNAL_CLD_MASK   (SIGNAL_CLD_STOPPED|SIGNAL_CLD_CONTINUED)

Definition at line 654 of file sched.h.

#define SIGNAL_CLD_STOPPED   0x00000010

Definition at line 652 of file sched.h.

#define SIGNAL_GROUP_EXIT   0x00000004 /* group exit in progress */

Definition at line 648 of file sched.h.

#define SIGNAL_STOP_CONTINUED   0x00000002 /* SIGCONT since WCONTINUED reap */

Definition at line 647 of file sched.h.

#define SIGNAL_STOP_STOPPED   0x00000001 /* job control stop in effect */

Definition at line 646 of file sched.h.

#define SIGNAL_UNKILLABLE   0x00000040 /* for init: ignore fatal signals */

Definition at line 656 of file sched.h.

#define SUID_DUMPABLE_DISABLED   0

Definition at line 370 of file sched.h.

#define SUID_DUMPABLE_ENABLED   1

Definition at line 371 of file sched.h.

#define SUID_DUMPABLE_SAFE   2

Definition at line 372 of file sched.h.

#define TASK_ALL   (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED)

Definition at line 170 of file sched.h.

#define TASK_COMM_LEN   16

Definition at line 208 of file sched.h.

#define task_contributes_to_load (   task)
Value:
((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
(task->flags & PF_FROZEN) == 0)

Definition at line 182 of file sched.h.

#define TASK_DEAD   64

Definition at line 153 of file sched.h.

#define TASK_INTERRUPTIBLE   1

Definition at line 145 of file sched.h.

#define task_is_dead (   task)    ((task)->exit_state != 0)

Definition at line 179 of file sched.h.

#define task_is_stopped (   task)    ((task->state & __TASK_STOPPED) != 0)

Definition at line 178 of file sched.h.

#define task_is_stopped_or_traced (   task)    ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)

Definition at line 180 of file sched.h.

#define task_is_traced (   task)    ((task->state & __TASK_TRACED) != 0)

Definition at line 177 of file sched.h.

#define TASK_KILLABLE   (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)

Definition at line 164 of file sched.h.

#define TASK_NORMAL   (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)

Definition at line 169 of file sched.h.

#define TASK_REPORT
Value:
TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \
__TASK_TRACED)

Definition at line 173 of file sched.h.

#define TASK_RUNNING   0

Definition at line 144 of file sched.h.

#define TASK_SIZE_OF (   tsk)    TASK_SIZE

Definition at line 2753 of file sched.h.

#define task_stack_page (   task)    ((task)->stack)

Definition at line 2473 of file sched.h.

#define TASK_STATE_MAX   512

Definition at line 156 of file sched.h.

#define TASK_STATE_TO_CHAR_STR   "RSDTtZXxKW"

Definition at line 158 of file sched.h.

#define TASK_STOPPED   (TASK_WAKEKILL | __TASK_STOPPED)

Definition at line 165 of file sched.h.

#define task_thread_info (   task)    ((struct thread_info *)(task)->stack)

Definition at line 2472 of file sched.h.

#define TASK_TRACED   (TASK_WAKEKILL | __TASK_TRACED)

Definition at line 166 of file sched.h.

#define TASK_UNINTERRUPTIBLE   2

Definition at line 146 of file sched.h.

#define TASK_WAKEKILL   128

Definition at line 154 of file sched.h.

#define TASK_WAKING   256

Definition at line 155 of file sched.h.

#define tsk_cpus_allowed (   tsk)    (&(tsk)->cpus_allowed)

Definition at line 1554 of file sched.h.

#define tsk_used_math (   p)    ((p)->flags & PF_USED_MATH)

Definition at line 1788 of file sched.h.

#define used_math ( )    tsk_used_math(current)

Definition at line 1789 of file sched.h.

#define virt_exp   utime

Definition at line 454 of file sched.h.

#define WF_FORK   0x02 /* child wakeup after fork */

Definition at line 1036 of file sched.h.

#define WF_MIGRATED   0x04 /* internal use, task got migrated */

Definition at line 1037 of file sched.h.

#define WF_SYNC   0x01 /* waker goes to sleep after wakup */

Definition at line 1035 of file sched.h.

#define while_each_thread (   g,
  t 
)    while ((t = next_thread(t)) != g)

Definition at line 2329 of file sched.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
sysctl_hung_task_timeout_secs 

Definition at line 307 of file sched.h.

Enumerator:
CPU_IDLE 
CPU_NOT_IDLE 
CPU_NEWLY_IDLE 
CPU_MAX_IDLE_TYPES 

Definition at line 772 of file sched.h.

Enumerator:
perf_invalid_context 
perf_hw_context 
perf_sw_context 
perf_nr_task_contexts 

Definition at line 1183 of file sched.h.

Enumerator:
SCHED_TUNABLESCALING_NONE 
SCHED_TUNABLESCALING_LOG 
SCHED_TUNABLESCALING_LINEAR 
SCHED_TUNABLESCALING_END 

Definition at line 1985 of file sched.h.

Function Documentation

void __cleanup_sighand ( struct sighand_struct )

Definition at line 995 of file fork.c.

int __cond_resched_lock ( spinlock_t lock)

Definition at line 4219 of file core.c.

int __cond_resched_softirq ( void  )

Definition at line 4239 of file core.c.

void __flush_signals ( struct task_struct )

Definition at line 414 of file signal.c.

int __kill_pgrp_info ( int  sig,
struct siginfo info,
struct pid pgrp 
)

Definition at line 1332 of file signal.c.

struct sighand_struct* __lock_task_sighand ( struct task_struct tsk,
unsigned long flags 
)
read

Definition at line 1282 of file signal.c.

void __mmdrop ( struct mm_struct )

Definition at line 593 of file fork.c.

void __put_task_struct ( struct task_struct t)

Definition at line 233 of file fork.c.

void __set_special_pids ( struct pid pid)

Definition at line 362 of file exit.c.

pid_t __task_pid_nr_ns ( struct task_struct task,
enum pid_type  type,
struct pid_namespace ns 
)

Definition at line 490 of file pid.c.

void __wake_up_parent ( struct task_struct p,
struct task_struct parent 
)

Definition at line 1609 of file exit.c.

int _cond_resched ( void  )

Definition at line 4201 of file core.c.

struct user_struct* alloc_uid ( kuid_t  )
read

Definition at line 165 of file user.c.

int allow_signal ( int  )

Definition at line 384 of file exit.c.

void block_all_signals ( int(*)(void *priv notifier,
void priv,
sigset_t mask 
)

Definition at line 513 of file signal.c.

void calc_global_load ( unsigned long  ticks)

Definition at line 2302 of file core.c.

int can_nice ( const struct task_struct p,
const int  nice 
)

Definition at line 3560 of file core.c.

int copy_thread ( unsigned  long,
unsigned  long,
unsigned  long,
struct task_struct ,
struct pt_regs  
)

Definition at line 269 of file process.c.

u64 cpu_clock ( int  cpu)

Definition at line 337 of file clock.c.

void cpu_init ( void  )

cpu_init

This is our initial entry point for each CPU, and is invoked on the boot CPU prior to calling start_kernel(). For SMP, a combination of this and start_secondary() will bring up each processor to a ready state prior to hand forking the idle loop.

We do all of the basic processor init here, including setting up the caches, FPU, DSP, etc. By the time start_kernel() is hit (and subsequently platform_setup()) things like determining the CPU subtype and initial configuration will all be done.

Each processor family is still responsible for doing its own probing and cache configuration in cpu_probe().

Definition at line 376 of file setup.c.

struct task_struct* curr_task ( int  cpu)
read
bool current_is_single_threaded ( void  )

Definition at line 18 of file is_single_threaded.c.

void daemonize ( const char ,
  ... 
)

Definition at line 424 of file exit.c.

DECLARE_PER_CPU ( unsigned  long,
process_counts   
)
int dequeue_signal ( struct task_struct tsk,
sigset_t mask,
siginfo_t info 
)

Definition at line 602 of file signal.c.

int disallow_signal ( int  )

Definition at line 405 of file exit.c.

int do_execve ( const char ,
const char __user *const __user ,
const char __user *const __user ,
struct pt_regs  
)

Definition at line 1567 of file exec.c.

long do_fork ( unsigned  long,
unsigned  long,
struct pt_regs ,
unsigned  long,
int __user ,
int __user  
)

Definition at line 1555 of file fork.c.

void do_group_exit ( int  )

Definition at line 1011 of file exit.c.

__must_check bool do_notify_parent ( struct task_struct ,
int   
)

Definition at line 1633 of file signal.c.

int do_sigaction ( int  ,
struct k_sigaction ,
struct k_sigaction  
)

Definition at line 2996 of file signal.c.

int do_sigaltstack ( const stack_t __user ,
stack_t __user ,
unsigned  long 
)

Definition at line 3042 of file signal.c.

struct mm_struct* dup_mm ( struct task_struct tsk)
read

Definition at line 806 of file fork.c.

void exit_files ( struct task_struct )

Definition at line 481 of file file.c.

void exit_itimers ( struct signal_struct )

Definition at line 940 of file posix-timers.c.

void exit_thread ( void  )
inline

Definition at line 216 of file process.c.

struct task_struct* find_task_by_pid_ns ( pid_t  nr,
struct pid_namespace ns 
)
read

Definition at line 421 of file pid.c.

struct task_struct* find_task_by_vpid ( pid_t  nr)
read

Definition at line 429 of file pid.c.

struct user_struct* find_user ( kuid_t  )
read

Definition at line 140 of file user.c.

void flush_itimer_signals ( void  )

Definition at line 453 of file signal.c.

void flush_signal_handlers ( struct task_struct ,
int  force_default 
)

Definition at line 479 of file signal.c.

void flush_signals ( struct task_struct )

Definition at line 421 of file signal.c.

void flush_thread ( void  )

Definition at line 221 of file process.c.

void force_sig ( int  ,
struct task_struct  
)

Definition at line 1496 of file signal.c.

int force_sig_info ( int  ,
struct siginfo ,
struct task_struct  
)

Definition at line 1233 of file signal.c.

int force_sigsegv ( int  ,
struct task_struct  
)

Definition at line 1508 of file signal.c.

struct task_struct* fork_idle ( int  )
read

Definition at line 1534 of file fork.c.

void free_task ( struct task_struct tsk)

Definition at line 207 of file fork.c.

void free_uid ( struct user_struct )

Definition at line 151 of file user.c.

void get_avenrun ( unsigned long loads,
unsigned long  offset,
int  shift 
)

get_avenrun - get the load average array : pointer to dest load array : offset to add : shift count to shift the result left

These values are estimates at best, so no need for locking.

Definition at line 2031 of file core.c.

int get_dumpable ( struct mm_struct mm)

Definition at line 1658 of file exec.c.

unsigned long get_parent_ip ( unsigned long  addr)

Definition at line 2645 of file core.c.

char* get_task_comm ( char to,
struct task_struct tsk 
)

Definition at line 1011 of file exec.c.

struct mm_struct* get_task_mm ( struct task_struct task)
read

get_task_mm - acquire a reference to the task's mm

Returns NULL if the task has no mm. Checks PF_KTHREAD (meaning this kernel workthread has transiently adopted a user mm with use_mm, to do its AIO) is not set and if so returns a reference to it, after bumping up the use count. User must release the mm via mmput() after use. Typically used by /proc and ptrace.

Definition at line 668 of file fork.c.

int idle_cpu ( int  cpu)

idle_cpu - is a given cpu idle currently? : the processor in question.

Definition at line 3638 of file core.c.

struct task_struct* idle_task ( int  cpu)
read

idle_task - return the idle task for a given cpu. : the processor in question.

Definition at line 3660 of file core.c.

void ignore_signals ( struct task_struct )

Definition at line 464 of file signal.c.

int in_sched_functions ( unsigned long  addr)

Definition at line 6726 of file core.c.

void init_idle ( struct task_struct idle,
int  cpu 
)

init_idle - set up an idle thread for a given CPU : task in question : cpu the idle task belongs to

NOTE: this function does not set the idle thread's NEED_RESCHED flag, to make booting more robust.

Definition at line 4551 of file core.c.

void init_idle_bootup_task ( struct task_struct idle)

Definition at line 4538 of file core.c.

void io_schedule ( void  )

Definition at line 4347 of file core.c.

long io_schedule_timeout ( long  timeout)

Definition at line 4362 of file core.c.

int is_container_init ( struct task_struct tsk)

Definition at line 84 of file pid.c.

int kill_pgrp ( struct pid pid,
int  sig,
int  priv 
)

Definition at line 1520 of file signal.c.

int kill_pid ( struct pid pid,
int  sig,
int  priv 
)

Definition at line 1532 of file signal.c.

int kill_pid_info ( int  sig,
struct siginfo info,
struct pid pid 
)

Definition at line 1347 of file signal.c.

int kill_pid_info_as_cred ( int  ,
struct siginfo ,
struct pid ,
const struct cred ,
u32   
)

Definition at line 1391 of file signal.c.

int kill_proc_info ( int  ,
struct siginfo ,
pid_t   
)

Definition at line 1371 of file signal.c.

u64 local_clock ( void  )

Definition at line 342 of file clock.c.

struct mm_struct* mm_access ( struct task_struct task,
unsigned int  mode 
)
read

Definition at line 685 of file fork.c.

struct mm_struct* mm_alloc ( void  )
read

Definition at line 575 of file fork.c.

void mm_release ( struct task_struct ,
struct mm_struct  
)

Definition at line 750 of file fork.c.

void mmput ( struct mm_struct )

Definition at line 607 of file fork.c.

int mutex_spin_on_owner ( struct mutex lock,
struct task_struct owner 
)
void normalize_rt_tasks ( void  )
unsigned long nr_iowait ( void  )

Definition at line 1947 of file core.c.

unsigned long nr_iowait_cpu ( int  cpu)

Definition at line 1957 of file core.c.

int nr_processes ( void  )

Definition at line 106 of file fork.c.

unsigned long nr_running ( void  )

Definition at line 1909 of file core.c.

unsigned long nr_uninterruptible ( void  )

Definition at line 1919 of file core.c.

void proc_caches_init ( void  )

Definition at line 1660 of file fork.c.

void recalc_sigpending ( void  )

Definition at line 154 of file signal.c.

void recalc_sigpending_and_wake ( struct task_struct t)

Definition at line 148 of file signal.c.

void release_task ( struct task_struct p)

Definition at line 180 of file exit.c.

int runqueue_is_locked ( int  cpu)
unsigned long long notrace sched_clock ( void  )

Definition at line 164 of file sched_clock.c.

u64 sched_clock_cpu ( int  cpu)

Definition at line 329 of file clock.c.

void sched_clock_init ( void  )

Definition at line 324 of file clock.c.

void sched_dead ( struct task_struct p)
void sched_fork ( struct task_struct p)

Definition at line 1541 of file core.c.

long sched_getaffinity ( pid_t  pid,
struct cpumask mask 
)

Definition at line 4099 of file core.c.

void sched_init ( void  )

Definition at line 6740 of file core.c.

void sched_init_smp ( void  )

Definition at line 6718 of file core.c.

int sched_rt_handler ( struct ctl_table table,
int  write,
void __user buffer,
size_t lenp,
loff_t *  ppos 
)

Definition at line 7432 of file core.c.

long sched_setaffinity ( pid_t  pid,
const struct cpumask new_mask 
)

Definition at line 4003 of file core.c.

int sched_setscheduler ( struct task_struct p,
int  policy,
const struct sched_param param 
)

sched_setscheduler - change the scheduling policy and/or RT priority of a thread. : the task in question. : new policy.

Parameters
structure containing the new RT priority.

NOTE that the task may be already dead.

Definition at line 3867 of file core.c.

int sched_setscheduler_nocheck ( struct task_struct p,
int  policy,
const struct sched_param param 
)

sched_setscheduler_nocheck - change the scheduling policy and/or RT priority of a thread from kernelspace. : the task in question. : new policy.

Parameters
structure containing the new RT priority.

Just like sched_setscheduler, only don't bother checking if the current context has permission. For example, this is needed in stop_machine(): we create temporary high priority worker threads, but our caller might not have that capability.

Definition at line 3885 of file core.c.

void sched_show_task ( struct task_struct p)

Definition at line 4474 of file core.c.

asmlinkage void schedule ( void  )

Definition at line 2905 of file core.c.

void schedule_preempt_disabled ( void  )

schedule_preempt_disabled - called with preemption disabled

Returns with preemption disabled. Note: preempt_count must be 1

Definition at line 2934 of file core.c.

asmlinkage void schedule_tail ( struct task_struct prev) -> lock)

schedule_tail - first thing a freshly forked thread must call. : the thread we just switched away from.

Definition at line 1826 of file core.c.

signed long schedule_timeout ( signed long  timeout)

schedule_timeout - sleep until timeout : timeout value in jiffies

Make the current task sleep until jiffies have elapsed. The routine will return immediately unless the current task state has been set (see set_current_state()).

You can set the task state as follows -

TASK_UNINTERRUPTIBLE - at least jiffies are guaranteed to pass before the routine returns. The routine will return 0

TASK_INTERRUPTIBLE - the routine may return early if a signal is delivered to the current task. In this case the remaining time in jiffies will be returned, or 0 if the timer expired in time

The current task state is guaranteed to be TASK_RUNNING when this routine returns.

Specifying a value of MAX_SCHEDULE_TIMEOUT will schedule the CPU away without a bound on the timeout. In this case the return value will be MAX_SCHEDULE_TIMEOUT.

In all cases the return value is guaranteed to be non-negative.

Definition at line 1484 of file timer.c.

signed long schedule_timeout_interruptible ( signed long  timeout)

Definition at line 1539 of file timer.c.

signed long schedule_timeout_killable ( signed long  timeout)

Definition at line 1546 of file timer.c.

signed long schedule_timeout_uninterruptible ( signed long  timeout)

Definition at line 1553 of file timer.c.

void scheduler_tick ( void  )

Definition at line 2623 of file core.c.

int send_sig ( int  ,
struct task_struct ,
int   
)

Definition at line 1490 of file signal.c.

int send_sig_info ( int  ,
struct siginfo ,
struct task_struct  
)

Definition at line 1474 of file signal.c.

int send_sigqueue ( struct sigqueue ,
struct task_struct ,
int  group 
)

Definition at line 1582 of file signal.c.

void set_curr_task ( int  cpu,
struct task_struct p 
)
void set_dumpable ( struct mm_struct mm,
int  value 
)

Definition at line 1629 of file exec.c.

void set_task_comm ( struct task_struct tsk,
char from 
)

Definition at line 1026 of file exec.c.

void set_user_nice ( struct task_struct p,
long  nice 
)

Definition at line 3508 of file core.c.

void show_regs ( struct pt_regs )

Definition at line 195 of file process.c.

void show_stack ( struct task_struct task,
unsigned long sp 
)

Definition at line 148 of file traps.c.

void show_state_filter ( unsigned long  state_filter)

Definition at line 4503 of file core.c.

void signal_wake_up ( struct task_struct t,
int  resume_stopped 
)

Definition at line 682 of file signal.c.

struct sigqueue* sigqueue_alloc ( void  )
read

Definition at line 1547 of file signal.c.

void sigqueue_free ( struct sigqueue )

Definition at line 1557 of file signal.c.

int task_can_switch_user ( struct user_struct up,
struct task_struct tsk 
)
void task_clear_jobctl_pending ( struct task_struct task,
unsigned int  mask 
)

task_clear_jobctl_pending - clear jobctl pending bits : target task : pending bits to clear

Clear from ->jobctl. must be subset of JOBCTL_PENDING_MASK. If JOBCTL_STOP_PENDING is being cleared, other STOP bits are cleared together.

If clearing of leaves no stop or trap pending, this function calls task_clear_jobctl_trapping().

CONTEXT: Must be called with ->sighand->siglock held.

Definition at line 295 of file signal.c.

void task_clear_jobctl_trapping ( struct task_struct task)

task_clear_jobctl_trapping - clear jobctl trapping bit : target task

If JOBCTL_TRAPPING is set, a ptracer is waiting for us to enter TRACED. Clear it and wake up the ptracer. Note that we don't need any further locking. ->siglock guarantees that ->parent points to the ptracer.

CONTEXT: Must be called with ->sighand->siglock held.

Definition at line 272 of file signal.c.

int task_curr ( const struct task_struct p)
inline

task_curr - is this task currently executing on a CPU? : the task in question.

Definition at line 883 of file core.c.

int task_nice ( const struct task_struct p)

task_nice - return the nice value of a given task. : the task in question.

Definition at line 3628 of file core.c.

int task_prio ( const struct task_struct p)

task_prio - return the priority value of a given task. : the task in question.

This is the priority value as seen by users in /proc. RT tasks are offset by -200. Normal tasks are centered around 0, value goes from -16 to +15.

Definition at line 3619 of file core.c.

unsigned long long task_sched_runtime ( struct task_struct task)

Definition at line 2606 of file core.c.

bool task_set_jobctl_pending ( struct task_struct task,
unsigned int  mask 
)

task_set_jobctl_pending - set jobctl pending bits : target task : pending bits to set

Clear from ->jobctl. must be subset of JOBCTL_PENDING_MASK | JOBCTL_STOP_CONSUME | JOBCTL_STOP_SIGMASK | JOBCTL_TRAPPING. If stop signo is being set, the existing signo is cleared. If is already being killed or exiting, this function becomes noop.

CONTEXT: Must be called with ->sighand->siglock held.

RETURNS: true if is set, false if made noop because was dying.

Definition at line 244 of file signal.c.

pid_t task_tgid_nr_ns ( struct task_struct tsk,
struct pid_namespace ns 
)

Definition at line 509 of file pid.c.

void task_times ( struct task_struct p,
cputime_t ut,
cputime_t st 
)

Definition at line 481 of file cputime.c.

unsigned long this_cpu_load ( void  )

Definition at line 1963 of file core.c.

void thread_group_cputime ( struct task_struct tsk,
struct task_cputime times 
)

Definition at line 220 of file posix-cpu-timers.c.

Definition at line 256 of file posix-cpu-timers.c.

void thread_group_times ( struct task_struct p,
cputime_t ut,
cputime_t st 
)

Definition at line 508 of file cputime.c.

void thread_info_cache_init ( void  )

Definition at line 446 of file main.c.

void trap_init ( void  )

Definition at line 1070 of file traps.c.

int uids_sysfs_init ( void  )
void unblock_all_signals ( void  )

Definition at line 527 of file signal.c.

void update_cpu_load_nohz ( void  )
void update_process_times ( int  user)

Definition at line 1345 of file timer.c.

void wake_up_new_task ( struct task_struct tsk)

Definition at line 1622 of file core.c.

int wake_up_process ( struct task_struct p)

wake_up_process - Wake up a specific process : The process to be woken up.

Attempt to wake up the nominated process and move it to the set of runnable processes. Returns 1 if the process was woken up, 0 if it was already running.

It may be assumed that this function implies a write memory barrier before changing the task state if and only if any tasks are woken up.

Definition at line 1498 of file core.c.

int wake_up_state ( struct task_struct tsk,
unsigned int  state 
)

Definition at line 1504 of file core.c.

void xtime_update ( unsigned long  ticks)

xtime_update() - advances the timekeeping infrastructure : number of ticks, that have elapsed since the last call.

Must be called with interrupts disabled.

Definition at line 1390 of file timekeeping.c.

void yield ( void  )

yield - yield the current processor to other threads.

Do not ever use this function, there's a 99% chance you're doing it wrong.

The scheduler is at all times free to pick the calling task as the most eligible task to run, if removing the yield() call from your code breaks it, its already broken.

Typical broken usage is:

while (!event) yield();

where one assumes that yield() will let 'the other' process run that will make event true. If the current task is a SCHED_FIFO task that will never happen. Never use yield() as a progress guarantee!!

If you want to use yield() to wait for something, use wait_event(). If you want to use yield() to be 'nice' for others, use cond_resched(). If you still want to use yield(), do not!

Definition at line 4275 of file core.c.

bool yield_to ( struct task_struct p,
bool  preempt 
)

yield_to - yield the current processor to another thread in your thread group, or accelerate that thread toward the processor it's on. : target task : whether task preemption is allowed or not

It's the caller's job to ensure that the target task struct can't go away on us before we can do any checks.

Returns true if we indeed boosted the target task.

Definition at line 4294 of file core.c.

int zap_other_threads ( struct task_struct p)

Definition at line 1261 of file signal.c.

Variable Documentation

char ___assert_task_state[1-2 *!!(sizeof(TASK_STATE_TO_CHAR_STR)-1!=ilog2(TASK_STATE_MAX)+1)]
char __sched_text_end[]
char __sched_text_start[]
unsigned long avenrun[]

Definition at line 94 of file appldata_os.c.

struct pid* cad_pid

Definition at line 117 of file sys.c.

struct exec_domain default_exec_domain

Definition at line 37 of file exec_domain.c.

struct mm_struct init_mm

Definition at line 16 of file init-mm.c.

struct pid_namespace init_pid_ns

Definition at line 71 of file pid.c.

struct task_struct init_task

Definition at line 16 of file init_task.c.

union thread_union init_thread_union
spinlock_t mmlist_lock
int nr_threads

Definition at line 93 of file appldata_os.c.

struct user_struct root_user

Definition at line 83 of file user.c.

int sysctl_max_map_count

Definition at line 63 of file nommu.c.

unsigned int sysctl_sched_child_runs_first
unsigned int sysctl_sched_latency

Definition at line 46 of file fair.c.

unsigned int sysctl_sched_min_granularity

Definition at line 65 of file fair.c.

unsigned int sysctl_sched_rt_period

Definition at line 280 of file core.c.

int sysctl_sched_rt_runtime

Definition at line 288 of file core.c.

enum sched_tunable_scaling sysctl_sched_tunable_scaling

Definition at line 59 of file fair.c.

unsigned int sysctl_sched_wakeup_granularity

Definition at line 87 of file fair.c.

rwlock_t tasklist_lock
unsigned long total_forks

Definition at line 89 of file fork.c.