]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/sched.h
Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mv-sheeva.git] / include / linux / sched.h
index 8f3e63cb33a629019edd5907a645efb71a7aa076..cbf2a3b46280a78f8d8cdfc408492fb1ac26fad3 100644 (file)
@@ -140,6 +140,10 @@ extern int nr_processes(void);
 extern unsigned long nr_running(void);
 extern unsigned long nr_uninterruptible(void);
 extern unsigned long nr_iowait(void);
+extern unsigned long nr_iowait_cpu(void);
+extern unsigned long this_cpu_load(void);
+
+
 extern void calc_global_load(void);
 extern u64 cpu_nr_migrations(int cpu);
 
@@ -422,6 +426,15 @@ static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
        return max(mm->hiwater_rss, get_mm_rss(mm));
 }
 
+static inline void setmax_mm_hiwater_rss(unsigned long *maxrss,
+                                        struct mm_struct *mm)
+{
+       unsigned long hiwater_rss = get_mm_hiwater_rss(mm);
+
+       if (*maxrss < hiwater_rss)
+               *maxrss = hiwater_rss;
+}
+
 static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
 {
        return max(mm->hiwater_vm, mm->total_vm);
@@ -480,6 +493,13 @@ struct pacct_struct {
        unsigned long           ac_minflt, ac_majflt;
 };
 
+struct cpu_itimer {
+       cputime_t expires;
+       cputime_t incr;
+       u32 error;
+       u32 incr_error;
+};
+
 /**
  * struct task_cputime - collected CPU time counts
  * @utime:             time spent in user mode, in &cputime_t units
@@ -574,9 +594,12 @@ struct signal_struct {
        struct pid *leader_pid;
        ktime_t it_real_incr;
 
-       /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */
-       cputime_t it_prof_expires, it_virt_expires;
-       cputime_t it_prof_incr, it_virt_incr;
+       /*
+        * ITIMER_PROF and ITIMER_VIRTUAL timers for the process, we use
+        * CPUCLOCK_PROF and CPUCLOCK_VIRT for indexing array as these
+        * values are defined to 0 and 1 respectively
+        */
+       struct cpu_itimer it[2];
 
        /*
         * Thread group totals for process CPU timers.
@@ -608,6 +631,7 @@ struct signal_struct {
        unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
        unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
        unsigned long inblock, oublock, cinblock, coublock;
+       unsigned long maxrss, cmaxrss;
        struct task_io_accounting ioac;
 
        /*
@@ -639,6 +663,8 @@ struct signal_struct {
        unsigned audit_tty;
        struct tty_audit_buf *tty_audit_buf;
 #endif
+
+       int oom_adj;    /* OOM kill score adjustment (bit shift) */
 };
 
 /* Context switch must be unlocked if interrupts are to be enabled */
@@ -1221,7 +1247,6 @@ struct task_struct {
         * a short time
         */
        unsigned char fpu_counter;
-       s8 oomkilladj; /* OOM kill score adjustment (bit shift). */
 #ifdef CONFIG_BLK_DEV_IO_TRACE
        unsigned int btrace_seq;
 #endif
@@ -1514,6 +1539,7 @@ struct task_struct {
        /* bitmask of trace recursion */
        unsigned long trace_recursion;
 #endif /* CONFIG_TRACING */
+       unsigned long stack_start;
 };
 
 /* Future-safe accessor for struct task_struct's cpus_allowed. */
@@ -1720,7 +1746,7 @@ extern cputime_t task_gtime(struct task_struct *p);
 #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_SWAPOFF     0x00080000      /* I am in swapoff */
+#define PF_OOM_ORIGIN  0x00080000      /* Allocating much memory to others */
 #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 */