diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/blktrace.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/block/blktrace.c b/block/blktrace.c index 2592f215a905..a45e61885037 100644 --- a/block/blktrace.c +++ b/block/blktrace.c | |||
@@ -476,6 +476,9 @@ static void blk_check_time(unsigned long long *t) | |||
476 | *t -= (a + b) / 2; | 476 | *t -= (a + b) / 2; |
477 | } | 477 | } |
478 | 478 | ||
479 | /* | ||
480 | * calibrate our inter-CPU timings | ||
481 | */ | ||
479 | static void blk_trace_check_cpu_time(void *data) | 482 | static void blk_trace_check_cpu_time(void *data) |
480 | { | 483 | { |
481 | unsigned long long *t; | 484 | unsigned long long *t; |
@@ -493,20 +496,6 @@ static void blk_trace_check_cpu_time(void *data) | |||
493 | put_cpu(); | 496 | put_cpu(); |
494 | } | 497 | } |
495 | 498 | ||
496 | /* | ||
497 | * Call blk_trace_check_cpu_time() on each CPU to calibrate our inter-CPU | ||
498 | * timings | ||
499 | */ | ||
500 | static void blk_trace_calibrate_offsets(void) | ||
501 | { | ||
502 | unsigned long flags; | ||
503 | |||
504 | smp_call_function(blk_trace_check_cpu_time, NULL, 1, 1); | ||
505 | local_irq_save(flags); | ||
506 | blk_trace_check_cpu_time(NULL); | ||
507 | local_irq_restore(flags); | ||
508 | } | ||
509 | |||
510 | static void blk_trace_set_ht_offsets(void) | 499 | static void blk_trace_set_ht_offsets(void) |
511 | { | 500 | { |
512 | #if defined(CONFIG_SCHED_SMT) | 501 | #if defined(CONFIG_SCHED_SMT) |
@@ -535,7 +524,7 @@ static void blk_trace_set_ht_offsets(void) | |||
535 | static __init int blk_trace_init(void) | 524 | static __init int blk_trace_init(void) |
536 | { | 525 | { |
537 | mutex_init(&blk_tree_mutex); | 526 | mutex_init(&blk_tree_mutex); |
538 | blk_trace_calibrate_offsets(); | 527 | on_each_cpu(blk_trace_check_cpu_time, NULL, 1, 1); |
539 | blk_trace_set_ht_offsets(); | 528 | blk_trace_set_ht_offsets(); |
540 | 529 | ||
541 | return 0; | 530 | return 0; |