perf_counter: More aggressive frequency adjustment

Also employ the overflow handler to adjust the frequency, this results
in a stable frequency in about 40~50 samples, instead of that many ticks.

This also means we can start sampling at a sample period of 1 without
running head-first into the throttle.

It relies on sched_clock() to accurately measure the time difference
between the overflow NMIs.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Peter Zijlstra
2009-06-10 13:40:57 +02:00
committed by Ingo Molnar
parent dc81081b2d
commit bd2b5b1284
3 changed files with 92 additions and 44 deletions

View File

@@ -371,6 +371,7 @@ struct hw_perf_counter {
u64 freq_count;
u64 freq_interrupts;
u64 freq_stamp;
#endif
};