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 <linux/sched.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/stop_machine.h>
#include "cpupri.h"
#include "stats.h"
#include "auto_group.h"
#include "features.h"

Go to the source code of this file.

Data Structures

struct  rt_prio_array
 
struct  rt_bandwidth
 
struct  cfs_bandwidth
 
struct  cfs_rq
 
struct  rt_rq
 
struct  rq
 

Macros

#define NICE_TO_PRIO(nice)   (MAX_RT_PRIO + (nice) + 20)
 
#define PRIO_TO_NICE(prio)   ((prio) - MAX_RT_PRIO - 20)
 
#define TASK_NICE(p)   PRIO_TO_NICE((p)->static_prio)
 
#define USER_PRIO(p)   ((p)-MAX_RT_PRIO)
 
#define TASK_USER_PRIO(p)   USER_PRIO((p)->static_prio)
 
#define MAX_USER_PRIO   (USER_PRIO(MAX_PRIO))
 
#define NS_TO_JIFFIES(TIME)   ((unsigned long)(TIME) / (NSEC_PER_SEC / HZ))
 
#define NICE_0_LOAD   SCHED_LOAD_SCALE
 
#define NICE_0_SHIFT   SCHED_LOAD_SHIFT
 
#define RUNTIME_INF   ((u64)~0ULL)
 
#define CPU_LOAD_IDX_MAX   5
 
#define cpu_rq(cpu)   (&per_cpu(runqueues, (cpu)))
 
#define this_rq()   (&__get_cpu_var(runqueues))
 
#define task_rq(p)   cpu_rq(task_cpu(p))
 
#define cpu_curr(cpu)   (cpu_rq(cpu)->curr)
 
#define raw_rq()   (&__raw_get_cpu_var(runqueues))
 
#define const_debug   const
 
#define SCHED_FEAT(name, enabled)   __SCHED_FEAT_##name ,
 
#define sched_feat(x)   (sysctl_sched_features & (1UL << __SCHED_FEAT_##x))
 
#define prepare_arch_switch(next)   do { } while (0)
 
#define finish_arch_switch(prev)   do { } while (0)
 
#define finish_arch_post_lock_switch()   do { } while (0)
 
#define WEIGHT_IDLEPRIO   3
 
#define WMULT_IDLEPRIO   1431655765
 
#define sched_class_highest   (&stop_sched_class)
 
#define for_each_class(class)   for (class = sched_class_highest; class; class = class->next)
 

Enumerations

enum  { __SCHED_FEAT_NR }
 
enum  cpuacct_stat_index { CPUACCT_STAT_USER, CPUACCT_STAT_SYSTEM, CPUACCT_STAT_NSTATS }
 

Functions

 DECLARE_PER_CPU (struct rq, runqueues)
 
void sysrq_sched_debug_show (void)
 
void sched_init_granularity (void)
 
void update_max_interval (void)
 
void update_group_power (struct sched_domain *sd, int cpu)
 
int update_runtime (struct notifier_block *nfb, unsigned long action, void *hcpu)
 
void init_sched_rt_class (void)
 
void init_sched_fair_class (void)
 
void resched_task (struct task_struct *p)
 
void resched_cpu (int cpu)
 
void init_rt_bandwidth (struct rt_bandwidth *rt_b, u64 period, u64 runtime)
 
void update_idle_cpu_load (struct rq *this_rq)
 
void update_rq_clock (struct rq *rq)
 
void activate_task (struct rq *rq, struct task_struct *p, int flags)
 
void deactivate_task (struct rq *rq, struct task_struct *p, int flags)
 
void check_preempt_curr (struct rq *rq, struct task_struct *p, int flags)
 
void start_bandwidth_timer (struct hrtimer *period_timer, ktime_t period)
 
struct sched_entity__pick_first_entity (struct cfs_rq *cfs_rq)
 
struct sched_entity__pick_last_entity (struct cfs_rq *cfs_rq)
 
void print_cfs_stats (struct seq_file *m, int cpu)
 
void print_rt_stats (struct seq_file *m, int cpu)
 
void init_cfs_rq (struct cfs_rq *cfs_rq)
 
void init_rt_rq (struct rt_rq *rt_rq, struct rq *rq)
 
void account_cfs_bandwidth_used (int enabled, int was_enabled)
 

Variables

__read_mostly int scheduler_running
 
struct mutex sched_domains_mutex
 
const_debug unsigned int sysctl_sched_features
 
struct sched_class stop_sched_class
 
struct sched_class rt_sched_class
 
struct sched_class fair_sched_class
 
struct sched_class idle_sched_class
 
struct rt_bandwidth def_rt_bandwidth
 
const_debug unsigned int sysctl_sched_time_avg
 
const_debug unsigned int sysctl_sched_nr_migrate
 
const_debug unsigned int sysctl_sched_migration_cost
 

Macro Definition Documentation

#define const_debug   const

Definition at line 609 of file sched.h.

#define cpu_curr (   cpu)    (cpu_rq(cpu)->curr)

Definition at line 486 of file sched.h.

#define CPU_LOAD_IDX_MAX   5

Definition at line 357 of file sched.h.

#define cpu_rq (   cpu)    (&per_cpu(runqueues, (cpu)))

Definition at line 483 of file sched.h.

#define finish_arch_post_lock_switch (   void)    do { } while (0)

Definition at line 688 of file sched.h.

#define finish_arch_switch (   prev)    do { } while (0)

Definition at line 685 of file sched.h.

#define for_each_class (   class)    for (class = sched_class_highest; class; class = class->next)

Definition at line 840 of file sched.h.

#define MAX_USER_PRIO   (USER_PRIO(MAX_PRIO))

Definition at line 27 of file sched.h.

#define NICE_0_LOAD   SCHED_LOAD_SCALE

Definition at line 34 of file sched.h.

#define NICE_0_SHIFT   SCHED_LOAD_SHIFT

Definition at line 35 of file sched.h.

#define NICE_TO_PRIO (   nice)    (MAX_RT_PRIO + (nice) + 20)

Definition at line 16 of file sched.h.

#define NS_TO_JIFFIES (   TIME)    ((unsigned long)(TIME) / (NSEC_PER_SEC / HZ))

Definition at line 32 of file sched.h.

#define prepare_arch_switch (   next)    do { } while (0)

Definition at line 682 of file sched.h.

#define PRIO_TO_NICE (   prio)    ((prio) - MAX_RT_PRIO - 20)

Definition at line 17 of file sched.h.

#define raw_rq ( )    (&__raw_get_cpu_var(runqueues))

Definition at line 487 of file sched.h.

#define RUNTIME_INF   ((u64)~0ULL)

Definition at line 44 of file sched.h.

#define sched_class_highest   (&stop_sched_class)

Definition at line 839 of file sched.h.

#define SCHED_FEAT (   name,
  enabled 
)    __SCHED_FEAT_##name ,

Definition at line 614 of file sched.h.

#define sched_feat (   x)    (sysctl_sched_features & (1UL << __SCHED_FEAT_##x))

Definition at line 648 of file sched.h.

#define TASK_NICE (   p)    PRIO_TO_NICE((p)->static_prio)

Definition at line 18 of file sched.h.

#define task_rq (   p)    cpu_rq(task_cpu(p))

Definition at line 485 of file sched.h.

#define TASK_USER_PRIO (   p)    USER_PRIO((p)->static_prio)

Definition at line 26 of file sched.h.

#define this_rq ( )    (&__get_cpu_var(runqueues))

Definition at line 484 of file sched.h.

#define USER_PRIO (   p)    ((p)-MAX_RT_PRIO)

Definition at line 25 of file sched.h.

#define WEIGHT_IDLEPRIO   3

Definition at line 786 of file sched.h.

#define WMULT_IDLEPRIO   1431655765

Definition at line 787 of file sched.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
__SCHED_FEAT_NR 

Definition at line 617 of file sched.h.

Enumerator:
CPUACCT_STAT_USER 
CPUACCT_STAT_SYSTEM 
CPUACCT_STAT_NSTATS 

Definition at line 831 of file sched.h.

Function Documentation

struct sched_entity* __pick_first_entity ( struct cfs_rq cfs_rq)
read

Definition at line 526 of file fair.c.

struct sched_entity* __pick_last_entity ( struct cfs_rq cfs_rq)
read
void account_cfs_bandwidth_used ( int  enabled,
int  was_enabled 
)
void activate_task ( struct rq rq,
struct task_struct p,
int  flags 
)

Definition at line 727 of file core.c.

void check_preempt_curr ( struct rq rq,
struct task_struct p,
int  flags 
)

Definition at line 900 of file core.c.

void deactivate_task ( struct rq rq,
struct task_struct p,
int  flags 
)

Definition at line 735 of file core.c.

DECLARE_PER_CPU ( struct rq  ,
runqueues   
)
void init_cfs_rq ( struct cfs_rq cfs_rq)

Definition at line 5088 of file fair.c.

void init_rt_bandwidth ( struct rt_bandwidth rt_b,
u64  period,
u64  runtime 
)

Definition at line 35 of file rt.c.

void init_rt_rq ( struct rt_rq rt_rq,
struct rq rq 
)

Definition at line 60 of file rt.c.

void init_sched_fair_class ( void  )

Definition at line 5356 of file fair.c.

void init_sched_rt_class ( void  )
void print_cfs_stats ( struct seq_file m,
int  cpu 
)
void print_rt_stats ( struct seq_file m,
int  cpu 
)
void resched_cpu ( int  cpu)
void resched_task ( struct task_struct p)

Definition at line 643 of file core.c.

void sched_init_granularity ( void  )

Definition at line 155 of file fair.c.

void start_bandwidth_timer ( struct hrtimer period_timer,
ktime_t  period 
)

Definition at line 91 of file core.c.

void sysrq_sched_debug_show ( void  )

Definition at line 383 of file debug.c.

void update_group_power ( struct sched_domain *  sd,
int  cpu 
)
void update_idle_cpu_load ( struct rq this_rq)
void update_max_interval ( void  )
void update_rq_clock ( struct rq rq)

Definition at line 116 of file core.c.

int update_runtime ( struct notifier_block nfb,
unsigned long  action,
void hcpu 
)

Variable Documentation

struct rt_bandwidth def_rt_bandwidth

Definition at line 12 of file rt.c.

struct sched_class fair_sched_class

Definition at line 216 of file fair.c.

struct sched_class idle_sched_class

Definition at line 75 of file idle_task.c.

struct sched_class rt_sched_class

Definition at line 2049 of file rt.c.

struct mutex sched_domains_mutex
__read_mostly int scheduler_running

Definition at line 282 of file core.c.

struct sched_class stop_sched_class

Definition at line 105 of file stop_task.c.

const_debug unsigned int sysctl_sched_features

Definition at line 135 of file core.c.

const_debug unsigned int sysctl_sched_migration_cost

Definition at line 90 of file fair.c.

const_debug unsigned int sysctl_sched_nr_migrate

Definition at line 266 of file core.c.

const_debug unsigned int sysctl_sched_time_avg

Definition at line 274 of file core.c.