diff options
| author | Ingo Molnar <mingo@elte.hu> | 2007-06-01 03:47:16 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-01 11:18:30 -0400 |
| commit | c1a834dc704763673df10282995257f2de93cbe9 (patch) | |
| tree | 66a0bc5ffbf6732eaa5fc6f554c13b235005c4cd /kernel/time | |
| parent | 9fcc15ec3c1c287a781a4620e52522b6186f26f6 (diff) | |
timer stats: speedups
Make timer-stats have almost zero overhead when enabled in the config but
not used. (this way distros can enable it more easily)
Also update the documentation about overhead of timer_stats - it was
written for the first version which had a global lock and a linear list
walk based lookup ;-)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/time')
| -rw-r--r-- | kernel/time/timer_stats.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c index fa3d380ca8c0..321693724ad7 100644 --- a/kernel/time/timer_stats.c +++ b/kernel/time/timer_stats.c | |||
| @@ -236,10 +236,15 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | |||
| 236 | /* | 236 | /* |
| 237 | * It doesnt matter which lock we take: | 237 | * It doesnt matter which lock we take: |
| 238 | */ | 238 | */ |
| 239 | spinlock_t *lock = &per_cpu(lookup_lock, raw_smp_processor_id()); | 239 | spinlock_t *lock; |
| 240 | struct entry *entry, input; | 240 | struct entry *entry, input; |
| 241 | unsigned long flags; | 241 | unsigned long flags; |
| 242 | 242 | ||
| 243 | if (likely(!active)) | ||
| 244 | return; | ||
| 245 | |||
| 246 | lock = &per_cpu(lookup_lock, raw_smp_processor_id()); | ||
| 247 | |||
| 243 | input.timer = timer; | 248 | input.timer = timer; |
| 244 | input.start_func = startf; | 249 | input.start_func = startf; |
| 245 | input.expire_func = timerf; | 250 | input.expire_func = timerf; |
