]> err.no Git - linux-2.6/blobdiff - include/linux/sched.h
[SPARC64]: Add __read_mostly support.
[linux-2.6] / include / linux / sched.h
index e7fd09b0557f5f952296241ad4c4baa28437c15d..ff48815bd3a2374600b0fce516f48ce3941599b1 100644 (file)
@@ -368,6 +368,11 @@ struct signal_struct {
 #endif
 };
 
+/* Context switch must be unlocked if interrupts are to be enabled */
+#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
+# define __ARCH_WANT_UNLOCKED_CTXSW
+#endif
+
 /*
  * Bits in flags field of signal_struct.
  */
@@ -460,10 +465,11 @@ enum idle_type
 #define SD_LOAD_BALANCE                1       /* Do load balancing on this domain. */
 #define SD_BALANCE_NEWIDLE     2       /* Balance when about to become idle */
 #define SD_BALANCE_EXEC                4       /* Balance on exec */
-#define SD_WAKE_IDLE           8       /* Wake to idle CPU on task wakeup */
-#define SD_WAKE_AFFINE         16      /* Wake task to waking CPU */
-#define SD_WAKE_BALANCE                32      /* Perform balancing at task wakeup */
-#define SD_SHARE_CPUPOWER      64      /* Domain members share cpu power */
+#define SD_BALANCE_FORK                8       /* Balance on fork, clone */
+#define SD_WAKE_IDLE           16      /* Wake to idle CPU on task wakeup */
+#define SD_WAKE_AFFINE         32      /* Wake task to waking CPU */
+#define SD_WAKE_BALANCE                64      /* Perform balancing at task wakeup */
+#define SD_SHARE_CPUPOWER      128     /* Domain members share cpu power */
 
 struct sched_group {
        struct sched_group *next;       /* Must be a circular list */
@@ -488,6 +494,11 @@ struct sched_domain {
        unsigned long long cache_hot_time; /* Task considered cache hot (ns) */
        unsigned int cache_nice_tries;  /* Leave cache hot tasks for # tries */
        unsigned int per_cpu_gain;      /* CPU % gained by adding domain cpus */
+       unsigned int busy_idx;
+       unsigned int idle_idx;
+       unsigned int newidle_idx;
+       unsigned int wake_idx;
+       unsigned int forkexec_idx;
        int flags;                      /* See SD_* */
 
        /* Runtime fields. */
@@ -511,10 +522,16 @@ struct sched_domain {
        unsigned long alb_failed;
        unsigned long alb_pushed;
 
-       /* sched_balance_exec() stats */
-       unsigned long sbe_attempts;
+       /* SD_BALANCE_EXEC stats */
+       unsigned long sbe_cnt;
+       unsigned long sbe_balanced;
        unsigned long sbe_pushed;
 
+       /* SD_BALANCE_FORK stats */
+       unsigned long sbf_cnt;
+       unsigned long sbf_balanced;
+       unsigned long sbf_pushed;
+
        /* try_to_wake_up() stats */
        unsigned long ttwu_wake_remote;
        unsigned long ttwu_move_affine;
@@ -522,6 +539,8 @@ struct sched_domain {
 #endif
 };
 
+extern void partition_sched_domains(cpumask_t *partition1,
+                                   cpumask_t *partition2);
 #ifdef ARCH_HAS_SCHED_DOMAIN
 /* Useful helpers that arch setup code may use. Defined in kernel/sched.c */
 extern cpumask_t cpu_isolated_map;
@@ -582,10 +601,15 @@ struct task_struct {
 
        int lock_depth;         /* BKL lock depth */
 
+#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
+       int oncpu;
+#endif
        int prio, static_prio;
        struct list_head run_list;
        prio_array_t *array;
 
+       unsigned short ioprio;
+
        unsigned long sleep_avg;
        unsigned long long timestamp, last_ran;
        unsigned long long sched_time; /* sched_clock time spent running */
@@ -704,8 +728,6 @@ struct task_struct {
        spinlock_t alloc_lock;
 /* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */
        spinlock_t proc_lock;
-/* context-switch lock */
-       spinlock_t switch_lock;
 
 /* journalling filesystem info */
        void *journal_info;
@@ -743,6 +765,7 @@ struct task_struct {
        nodemask_t mems_allowed;
        int cpuset_mems_generation;
 #endif
+       atomic_t fs_excl;       /* holding fs exclusive resources */
 };
 
 static inline pid_t process_group(struct task_struct *tsk)
@@ -912,7 +935,7 @@ extern void FASTCALL(wake_up_new_task(struct task_struct * tsk,
 #else
  static inline void kick_process(struct task_struct *tsk) { }
 #endif
-extern void FASTCALL(sched_fork(task_t * p));
+extern void FASTCALL(sched_fork(task_t * p, int clone_flags));
 extern void FASTCALL(sched_exit(task_t * p));
 
 extern int in_group_p(gid_t);
@@ -1092,7 +1115,8 @@ extern void unhash_process(struct task_struct *p);
 
 /*
  * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring
- * subscriptions and synchronises with wait4().  Also used in procfs.
+ * subscriptions and synchronises with wait4().  Also used in procfs.  Also
+ * pins the final release of task.io_context.
  *
  * Nests both inside and outside of read_lock(&tasklist_lock).
  * It must not be nested with write_lock_irq(&tasklist_lock),