]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - include/linux/sched.h
[PATCH] delay accounting taskstats interface send tgid once
[linux-2.6.git] / include / linux / sched.h
index 2f43f1fb7de79dac7a5af8846bbd778cf79c3520..6afa72e080cb7665bc4be600db1b4fe382460ccd 100644 (file)
@@ -463,6 +463,10 @@ struct signal_struct {
 #ifdef CONFIG_BSD_PROCESS_ACCT
        struct pacct_struct pacct;      /* per-process accounting information */
 #endif
+#ifdef CONFIG_TASKSTATS
+       spinlock_t stats_lock;
+       struct taskstats *stats;
+#endif
 };
 
 /* Context switch must be unlocked if interrupts are to be enabled */
@@ -537,7 +541,7 @@ extern struct user_struct root_user;
 struct backing_dev_info;
 struct reclaim_state;
 
-#ifdef CONFIG_SCHEDSTATS
+#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
 struct sched_info {
        /* cumulative counters */
        unsigned long   cpu_time,       /* time spent on the cpu */
@@ -548,9 +552,11 @@ struct sched_info {
        unsigned long   last_arrival,   /* when we last ran on a cpu */
                        last_queued;    /* when we were last queued to run */
 };
+#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
 
+#ifdef CONFIG_SCHEDSTATS
 extern struct file_operations proc_schedstat_operations;
-#endif
+#endif /* CONFIG_SCHEDSTATS */
 
 #ifdef CONFIG_TASK_DELAY_ACCT
 struct task_delay_info {
@@ -580,7 +586,19 @@ struct task_delay_info {
        u32 swapin_count;       /* total count of the number of swapin block */
                                /* io operations performed */
 };
+#endif /* CONFIG_TASK_DELAY_ACCT */
+
+static inline int sched_info_on(void)
+{
+#ifdef CONFIG_SCHEDSTATS
+       return 1;
+#elif defined(CONFIG_TASK_DELAY_ACCT)
+       extern int delayacct_on;
+       return delayacct_on;
+#else
+       return 0;
 #endif
+}
 
 enum idle_type
 {
@@ -777,7 +795,7 @@ struct task_struct {
        cpumask_t cpus_allowed;
        unsigned int time_slice, first_time_slice;
 
-#ifdef CONFIG_SCHEDSTATS
+#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
        struct sched_info sched_info;
 #endif
 
@@ -976,6 +994,7 @@ struct task_struct {
         */
        struct pipe_inode_info *splice_pipe;
 #ifdef CONFIG_TASK_DELAY_ACCT
+       spinlock_t delays_lock;
        struct task_delay_info *delays;
 #endif
 };