aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorChandra Seetharaman <sekharan@us.ibm.com>2006-07-14 03:24:38 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-15 00:53:56 -0400
commit52f17b6c2bd443e7806a161e9d10a983650db01d (patch)
tree67f9a8964a3ac78091cefcd7baf8935175a0a003 /include/linux/sched.h
parent0ff922452df86f3e9a2c6f705c4588ec62d096a7 (diff)
[PATCH] per-task-delay-accounting: cpu delay collection via schedstats
Make the task-related schedstats functions callable by delay accounting even if schedstats collection isn't turned on. This removes the dependency of delay accounting on schedstats. Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: Shailabh Nagar <nagar@watson.ibm.com> Signed-off-by: Balbir Singh <balbir@in.ibm.com> Cc: Jes Sorensen <jes@sgi.com> Cc: Peter Chubb <peterc@gelato.unsw.edu.au> Cc: Erich Focht <efocht@ess.nec.de> Cc: Levent Serinol <lserinol@gmail.com> Cc: Jay Lan <jlan@engr.sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2f43f1fb7de7..f751062d89a2 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -537,7 +537,7 @@ extern struct user_struct root_user;
537struct backing_dev_info; 537struct backing_dev_info;
538struct reclaim_state; 538struct reclaim_state;
539 539
540#ifdef CONFIG_SCHEDSTATS 540#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
541struct sched_info { 541struct sched_info {
542 /* cumulative counters */ 542 /* cumulative counters */
543 unsigned long cpu_time, /* time spent on the cpu */ 543 unsigned long cpu_time, /* time spent on the cpu */
@@ -548,9 +548,11 @@ struct sched_info {
548 unsigned long last_arrival, /* when we last ran on a cpu */ 548 unsigned long last_arrival, /* when we last ran on a cpu */
549 last_queued; /* when we were last queued to run */ 549 last_queued; /* when we were last queued to run */
550}; 550};
551#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
551 552
553#ifdef CONFIG_SCHEDSTATS
552extern struct file_operations proc_schedstat_operations; 554extern struct file_operations proc_schedstat_operations;
553#endif 555#endif /* CONFIG_SCHEDSTATS */
554 556
555#ifdef CONFIG_TASK_DELAY_ACCT 557#ifdef CONFIG_TASK_DELAY_ACCT
556struct task_delay_info { 558struct task_delay_info {
@@ -580,7 +582,19 @@ struct task_delay_info {
580 u32 swapin_count; /* total count of the number of swapin block */ 582 u32 swapin_count; /* total count of the number of swapin block */
581 /* io operations performed */ 583 /* io operations performed */
582}; 584};
585#endif /* CONFIG_TASK_DELAY_ACCT */
586
587static inline int sched_info_on(void)
588{
589#ifdef CONFIG_SCHEDSTATS
590 return 1;
591#elif defined(CONFIG_TASK_DELAY_ACCT)
592 extern int delayacct_on;
593 return delayacct_on;
594#else
595 return 0;
583#endif 596#endif
597}
584 598
585enum idle_type 599enum idle_type
586{ 600{
@@ -777,7 +791,7 @@ struct task_struct {
777 cpumask_t cpus_allowed; 791 cpumask_t cpus_allowed;
778 unsigned int time_slice, first_time_slice; 792 unsigned int time_slice, first_time_slice;
779 793
780#ifdef CONFIG_SCHEDSTATS 794#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
781 struct sched_info sched_info; 795 struct sched_info sched_info;
782#endif 796#endif
783 797