diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2008-01-25 15:08:34 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-25 15:08:34 -0500 |
commit | 9745512ce79de686df354dc70a8d1a74d801892d (patch) | |
tree | 9b64e2b2e6d2ae534beef136922082f21701c7b9 /kernel/sched_fair.c | |
parent | 326587b840785c60f5dc18557235a23bafefd620 (diff) |
sched: latencytop support
LatencyTOP kernel infrastructure; it measures latencies in the
scheduler and tracks it system wide and per process.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 3dab1ff83c4f..1b3b40ad7c54 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -20,6 +20,8 @@ | |||
20 | * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com> | 20 | * Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com> |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/latencytop.h> | ||
24 | |||
23 | /* | 25 | /* |
24 | * Targeted preemption latency for CPU-bound tasks: | 26 | * Targeted preemption latency for CPU-bound tasks: |
25 | * (default: 20ms * (1 + ilog(ncpus)), units: nanoseconds) | 27 | * (default: 20ms * (1 + ilog(ncpus)), units: nanoseconds) |
@@ -434,6 +436,7 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) | |||
434 | #ifdef CONFIG_SCHEDSTATS | 436 | #ifdef CONFIG_SCHEDSTATS |
435 | if (se->sleep_start) { | 437 | if (se->sleep_start) { |
436 | u64 delta = rq_of(cfs_rq)->clock - se->sleep_start; | 438 | u64 delta = rq_of(cfs_rq)->clock - se->sleep_start; |
439 | struct task_struct *tsk = task_of(se); | ||
437 | 440 | ||
438 | if ((s64)delta < 0) | 441 | if ((s64)delta < 0) |
439 | delta = 0; | 442 | delta = 0; |
@@ -443,9 +446,12 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) | |||
443 | 446 | ||
444 | se->sleep_start = 0; | 447 | se->sleep_start = 0; |
445 | se->sum_sleep_runtime += delta; | 448 | se->sum_sleep_runtime += delta; |
449 | |||
450 | account_scheduler_latency(tsk, delta >> 10, 1); | ||
446 | } | 451 | } |
447 | if (se->block_start) { | 452 | if (se->block_start) { |
448 | u64 delta = rq_of(cfs_rq)->clock - se->block_start; | 453 | u64 delta = rq_of(cfs_rq)->clock - se->block_start; |
454 | struct task_struct *tsk = task_of(se); | ||
449 | 455 | ||
450 | if ((s64)delta < 0) | 456 | if ((s64)delta < 0) |
451 | delta = 0; | 457 | delta = 0; |
@@ -462,11 +468,11 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) | |||
462 | * time that the task spent sleeping: | 468 | * time that the task spent sleeping: |
463 | */ | 469 | */ |
464 | if (unlikely(prof_on == SLEEP_PROFILING)) { | 470 | if (unlikely(prof_on == SLEEP_PROFILING)) { |
465 | struct task_struct *tsk = task_of(se); | ||
466 | 471 | ||
467 | profile_hits(SLEEP_PROFILING, (void *)get_wchan(tsk), | 472 | profile_hits(SLEEP_PROFILING, (void *)get_wchan(tsk), |
468 | delta >> 20); | 473 | delta >> 20); |
469 | } | 474 | } |
475 | account_scheduler_latency(tsk, delta >> 10, 0); | ||
470 | } | 476 | } |
471 | #endif | 477 | #endif |
472 | } | 478 | } |