summaryrefslogtreecommitdiff
path: root/kernel/sched_stats.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-06-20 12:36:55 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-06-20 12:36:55 -0700
commite570dc2a503f8334b700e8483082c675394f53fd (patch)
treecd188ec93f5bea1f06accbdc916876e891bdb9b0 /kernel/sched_stats.h
parentb1ae8d3a00530c035ef97fa4d97f4bee9be75c43 (diff)
parentd4abc238c9f4df8b3216f3e883f5d0a07b7ac75a (diff)
Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: sched, delay accounting: fix incorrect delay time when constantly waiting on runqueue sched: CPU hotplug events must not destroy scheduler domains created by the cpusets sched: rt-group: fix RR buglet sched: rt-group: heirarchy aware throttle sched: rt-group: fix hierarchy sched: NULL pointer dereference while setting sched_rt_period_us sched: fix defined-but-unused warning
Diffstat (limited to 'kernel/sched_stats.h')
-rw-r--r--kernel/sched_stats.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/sched_stats.h b/kernel/sched_stats.h
index a38878e0e49..80179ef7450 100644
--- a/kernel/sched_stats.h
+++ b/kernel/sched_stats.h
@@ -198,6 +198,9 @@ static inline void sched_info_queued(struct task_struct *t)
/*
* Called when a process ceases being the active-running process, either
* voluntarily or involuntarily. Now we can calculate how long we ran.
+ * Also, if the process is still in the TASK_RUNNING state, call
+ * sched_info_queued() to mark that it has now again started waiting on
+ * the runqueue.
*/
static inline void sched_info_depart(struct task_struct *t)
{
@@ -206,6 +209,9 @@ static inline void sched_info_depart(struct task_struct *t)
t->sched_info.cpu_time += delta;
rq_sched_info_depart(task_rq(t), delta);
+
+ if (t->state == TASK_RUNNING)
+ sched_info_queued(t);
}
/*