]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - include/linux/sched.h
Merge tag 'kvm-3.8-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[can-eth-gw-linux.git] / include / linux / sched.h
index e75cab5820ab563831d842a6f1ffa4d9c3b167aa..2c2f3072beef061faf0a2eb721ee2f05aad58d4a 100644 (file)
@@ -107,8 +107,18 @@ extern unsigned long this_cpu_load(void);
 extern void calc_global_load(unsigned long ticks);
 extern void update_cpu_load_nohz(void);
 
+/* Notifier for when a task gets migrated to a new CPU */
+struct task_migration_notifier {
+       struct task_struct *task;
+       int from_cpu;
+       int to_cpu;
+};
+extern void register_task_migration_notifier(struct notifier_block *n);
+
 extern unsigned long get_parent_ip(unsigned long addr);
 
+extern void dump_cpu_task(int cpu);
+
 struct seq_file;
 struct cfs_rq;
 struct task_group;
@@ -433,14 +443,29 @@ struct cpu_itimer {
        u32 incr_error;
 };
 
+/**
+ * struct cputime - snaphsot of system and user cputime
+ * @utime: time spent in user mode
+ * @stime: time spent in system mode
+ *
+ * Gathers a generic snapshot of user and system time.
+ */
+struct cputime {
+       cputime_t utime;
+       cputime_t stime;
+};
+
 /**
  * struct task_cputime - collected CPU time counts
  * @utime:             time spent in user mode, in &cputime_t units
  * @stime:             time spent in kernel mode, in &cputime_t units
  * @sum_exec_runtime:  total time spent on the CPU, in nanoseconds
  *
- * This structure groups together three kinds of CPU time that are
- * tracked for threads and thread groups.  Most things considering
+ * This is an extension of struct cputime that includes the total runtime
+ * spent by the task from the scheduler point of view.
+ *
+ * As a result, this structure groups together three kinds of CPU time
+ * that are tracked for threads and thread groups.  Most things considering
  * CPU time want to group these counts together and treat all three
  * of them in parallel.
  */
@@ -581,7 +606,7 @@ struct signal_struct {
        cputime_t gtime;
        cputime_t cgtime;
 #ifndef CONFIG_VIRT_CPU_ACCOUNTING
-       cputime_t prev_utime, prev_stime;
+       struct cputime prev_cputime;
 #endif
        unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
        unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
@@ -631,9 +656,10 @@ struct signal_struct {
        struct rw_semaphore group_rwsem;
 #endif
 
-       int oom_score_adj;      /* OOM kill score adjustment */
-       int oom_score_adj_min;  /* OOM kill score adjustment minimum value.
-                                * Only settable by CAP_SYS_RESOURCE. */
+       oom_flags_t oom_flags;
+       short oom_score_adj;            /* OOM kill score adjustment */
+       short oom_score_adj_min;        /* OOM kill score adjustment min value.
+                                        * Only settable by CAP_SYS_RESOURCE. */
 
        struct mutex cred_guard_mutex;  /* guard against foreign influences on
                                         * credential calculations
@@ -1340,7 +1366,7 @@ struct task_struct {
        cputime_t utime, stime, utimescaled, stimescaled;
        cputime_t gtime;
 #ifndef CONFIG_VIRT_CPU_ACCOUNTING
-       cputime_t prev_utime, prev_stime;
+       struct cputime prev_cputime;
 #endif
        unsigned long nvcsw, nivcsw; /* context switch counts */
        struct timespec start_time;             /* monotonic time */
@@ -1866,14 +1892,6 @@ static inline void rcu_copy_process(struct task_struct *p)
 
 #endif
 
-static inline void rcu_switch(struct task_struct *prev,
-                             struct task_struct *next)
-{
-#ifdef CONFIG_RCU_USER_QS
-       rcu_user_hooks_switch(prev, next);
-#endif
-}
-
 static inline void tsk_restore_flags(struct task_struct *task,
                                unsigned long orig_flags, unsigned long flags)
 {
@@ -2293,7 +2311,7 @@ extern void mm_release(struct task_struct *, struct mm_struct *);
 extern struct mm_struct *dup_mm(struct task_struct *tsk);
 
 extern int copy_thread(unsigned long, unsigned long, unsigned long,
-                       struct task_struct *, struct pt_regs *);
+                       struct task_struct *);
 extern void flush_thread(void);
 extern void exit_thread(void);
 
@@ -2305,14 +2323,13 @@ extern void flush_itimer_signals(void);
 
 extern void do_group_exit(int);
 
-extern void daemonize(const char *, ...);
 extern int allow_signal(int);
 extern int disallow_signal(int);
 
 extern int do_execve(const char *,
                     const char __user * const __user *,
-                    const char __user * const __user *, struct pt_regs *);
-extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
+                    const char __user * const __user *);
+extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
 struct task_struct *fork_idle(int);
 #ifdef CONFIG_GENERIC_KERNEL_THREAD
 extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);