Skip to content

Commit

Permalink
[PATCH] blktrace: cleanup using on_each_cpu
Browse files Browse the repository at this point in the history
This patch kills a few lines of code in blktrace by making use of
on_each_cpu().

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Martin Peschke authored and Jens Axboe committed Sep 30, 2006
1 parent cf342e5 commit 4090959
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions block/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ static void blk_check_time(unsigned long long *t)
*t -= (a + b) / 2;
}

/*
* calibrate our inter-CPU timings
*/
static void blk_trace_check_cpu_time(void *data)
{
unsigned long long *t;
Expand All @@ -493,20 +496,6 @@ static void blk_trace_check_cpu_time(void *data)
put_cpu();
}

/*
* Call blk_trace_check_cpu_time() on each CPU to calibrate our inter-CPU
* timings
*/
static void blk_trace_calibrate_offsets(void)
{
unsigned long flags;

smp_call_function(blk_trace_check_cpu_time, NULL, 1, 1);
local_irq_save(flags);
blk_trace_check_cpu_time(NULL);
local_irq_restore(flags);
}

static void blk_trace_set_ht_offsets(void)
{
#if defined(CONFIG_SCHED_SMT)
Expand Down Expand Up @@ -535,7 +524,7 @@ static void blk_trace_set_ht_offsets(void)
static __init int blk_trace_init(void)
{
mutex_init(&blk_tree_mutex);
blk_trace_calibrate_offsets();
on_each_cpu(blk_trace_check_cpu_time, NULL, 1, 1);
blk_trace_set_ht_offsets();

return 0;
Expand Down

0 comments on commit 4090959

Please sign in to comment.