aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/latencytop.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2010-11-29 08:27:07 +1100
committerJames Morris <jmorris@namei.org>2010-11-29 08:27:07 +1100
commit1d6d75684d869406e5bb2ac5d3ed9454f52d0cab (patch)
treeafb229254bed6415407b7b7d4641f9f792109966 /kernel/latencytop.c
parentkernel: add roundup() code comment from akpm (diff)
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 (diff)
downloadlinux-dev-1d6d75684d869406e5bb2ac5d3ed9454f52d0cab.tar.xz
linux-dev-1d6d75684d869406e5bb2ac5d3ed9454f52d0cab.zip
Merge branch 'master' into next
Diffstat (limited to 'kernel/latencytop.c')
-rw-r--r--kernel/latencytop.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/kernel/latencytop.c b/kernel/latencytop.c
index 877fb306d415..17110a4a4fc2 100644
--- a/kernel/latencytop.c
+++ b/kernel/latencytop.c
@@ -194,14 +194,7 @@ __account_scheduler_latency(struct task_struct *tsk, int usecs, int inter)
account_global_scheduler_latency(tsk, &lat);
- /*
- * short term hack; if we're > 32 we stop; future we recycle:
- */
- tsk->latency_record_count++;
- if (tsk->latency_record_count >= LT_SAVECOUNT)
- goto out_unlock;
-
- for (i = 0; i < LT_SAVECOUNT; i++) {
+ for (i = 0; i < tsk->latency_record_count; i++) {
struct latency_record *mylat;
int same = 1;
@@ -227,8 +220,14 @@ __account_scheduler_latency(struct task_struct *tsk, int usecs, int inter)
}
}
+ /*
+ * short term hack; if we're > 32 we stop; future we recycle:
+ */
+ if (tsk->latency_record_count >= LT_SAVECOUNT)
+ goto out_unlock;
+
/* Allocated a new one: */
- i = tsk->latency_record_count;
+ i = tsk->latency_record_count++;
memcpy(&tsk->latency_record[i], &lat, sizeof(struct latency_record));
out_unlock: