sched: cfs core, kernel/sched_fair.c
[powerpc.git] / include / linux / sched.h
index 75f4437..9042032 100644 (file)
@@ -34,6 +34,8 @@
 #define SCHED_FIFO             1
 #define SCHED_RR               2
 #define SCHED_BATCH            3
+/* SCHED_ISO: reserved but not implemented yet */
+#define SCHED_IDLE             5
 
 #ifdef __KERNEL__
 
@@ -88,6 +90,7 @@ struct sched_param {
 
 struct exec_domain;
 struct futex_pi_state;
+struct bio;
 
 /*
  * List of flags we want to share for kernel threads,
@@ -192,6 +195,7 @@ struct task_struct;
 extern void sched_init(void);
 extern void sched_init_smp(void);
 extern void init_idle(struct task_struct *idle, int cpu);
+extern void init_idle_bootup_task(struct task_struct *idle);
 
 extern cpumask_t nohz_cpu_mask;
 #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
@@ -391,6 +395,7 @@ struct sighand_struct {
        atomic_t                count;
        struct k_sigaction      action[_NSIG];
        spinlock_t              siglock;
+       struct list_head        signalfd_list;
 };
 
 struct pacct_struct {
@@ -637,18 +642,24 @@ static inline int sched_info_on(void)
 #endif
 }
 
-enum idle_type
-{
-       SCHED_IDLE,
-       NOT_IDLE,
-       NEWLY_IDLE,
-       MAX_IDLE_TYPES
+enum cpu_idle_type {
+       CPU_IDLE,
+       CPU_NOT_IDLE,
+       CPU_NEWLY_IDLE,
+       CPU_MAX_IDLE_TYPES
 };
 
 /*
  * sched-domains (multiprocessor balancing) declarations:
  */
-#define SCHED_LOAD_SCALE       128UL   /* increase resolution of load */
+
+/*
+ * Increase resolution of nice-level calculations:
+ */
+#define SCHED_LOAD_SHIFT       10
+#define SCHED_LOAD_SCALE       (1L << SCHED_LOAD_SHIFT)
+
+#define SCHED_LOAD_SCALE_FUZZ  (SCHED_LOAD_SCALE >> 5)
 
 #ifdef CONFIG_SMP
 #define SD_LOAD_BALANCE                1       /* Do load balancing on this domain. */
@@ -717,14 +728,14 @@ struct sched_domain {
 
 #ifdef CONFIG_SCHEDSTATS
        /* load_balance() stats */
-       unsigned long lb_cnt[MAX_IDLE_TYPES];
-       unsigned long lb_failed[MAX_IDLE_TYPES];
-       unsigned long lb_balanced[MAX_IDLE_TYPES];
-       unsigned long lb_imbalance[MAX_IDLE_TYPES];
-       unsigned long lb_gained[MAX_IDLE_TYPES];
-       unsigned long lb_hot_gained[MAX_IDLE_TYPES];
-       unsigned long lb_nobusyg[MAX_IDLE_TYPES];
-       unsigned long lb_nobusyq[MAX_IDLE_TYPES];
+       unsigned long lb_cnt[CPU_MAX_IDLE_TYPES];
+       unsigned long lb_failed[CPU_MAX_IDLE_TYPES];
+       unsigned long lb_balanced[CPU_MAX_IDLE_TYPES];
+       unsigned long lb_imbalance[CPU_MAX_IDLE_TYPES];
+       unsigned long lb_gained[CPU_MAX_IDLE_TYPES];
+       unsigned long lb_hot_gained[CPU_MAX_IDLE_TYPES];
+       unsigned long lb_nobusyg[CPU_MAX_IDLE_TYPES];
+       unsigned long lb_nobusyq[CPU_MAX_IDLE_TYPES];
 
        /* Active load balancing */
        unsigned long alb_cnt;
@@ -751,12 +762,6 @@ struct sched_domain {
 extern int partition_sched_domains(cpumask_t *partition1,
                                    cpumask_t *partition2);
 
-/*
- * Maximum cache size the migration-costs auto-tuning code will
- * search from:
- */
-extern unsigned int max_cache_size;
-
 #endif /* CONFIG_SMP */
 
 
@@ -1015,6 +1020,9 @@ struct task_struct {
 /* journalling filesystem info */
        void *journal_info;
 
+/* stacked block device info */
+       struct bio *bio_list, **bio_tail;
+
 /* VM state */
        struct reclaim_state *reclaim_state;
 
@@ -1157,6 +1165,7 @@ static inline void put_task_struct(struct task_struct *t)
                                        /* Not implemented yet, only for 486*/
 #define PF_STARTING    0x00000002      /* being created */
 #define PF_EXITING     0x00000004      /* getting shut down */
+#define PF_EXITPIDONE  0x00000008      /* pi exit done on shut down */
 #define PF_FORKNOEXEC  0x00000040      /* forked but didn't exec */
 #define PF_SUPERPRIV   0x00000100      /* used super-user privileges */
 #define PF_DUMPCORE    0x00000200      /* dumped core */
@@ -1177,6 +1186,7 @@ static inline void put_task_struct(struct task_struct *t)
 #define PF_SPREAD_SLAB 0x02000000      /* Spread some slab caches over cpuset */
 #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 freezeable */
 
 /*
  * Only the _current_ task can read/write to tsk->flags, but other
@@ -1233,6 +1243,14 @@ static inline void idle_task_exit(void) {}
 
 extern void sched_idle_next(void);
 
+extern unsigned int sysctl_sched_granularity;
+extern unsigned int sysctl_sched_wakeup_granularity;
+extern unsigned int sysctl_sched_batch_wakeup_granularity;
+extern unsigned int sysctl_sched_stat_granularity;
+extern unsigned int sysctl_sched_runtime_limit;
+extern unsigned int sysctl_sched_child_runs_first;
+extern unsigned int sysctl_sched_features;
+
 #ifdef CONFIG_RT_MUTEXES
 extern int rt_mutex_getprio(struct task_struct *p);
 extern void rt_mutex_setprio(struct task_struct *p, int prio);
@@ -1610,11 +1628,13 @@ static inline int lock_need_resched(spinlock_t *lock)
        return 0;
 }
 
-/* Reevaluate whether the task has signals pending delivery.
-   This is required every time the blocked sigset_t changes.
-   callers must hold sighand->siglock.  */
-
-extern FASTCALL(void recalc_sigpending_tsk(struct task_struct *t));
+/*
+ * Reevaluate whether the task has signals pending delivery.
+ * Wake the task if so.
+ * This is required every time the blocked sigset_t changes.
+ * callers must hold sighand->siglock.
+ */
+extern void recalc_sigpending_and_wake(struct task_struct *t);
 extern void recalc_sigpending(void);
 
 extern void signal_wake_up(struct task_struct *t, int resume_stopped);
@@ -1629,10 +1649,7 @@ static inline unsigned int task_cpu(const struct task_struct *p)
        return task_thread_info(p)->cpu;
 }
 
-static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
-{
-       task_thread_info(p)->cpu = cpu;
-}
+extern void set_task_cpu(struct task_struct *p, unsigned int cpu);
 
 #else