mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-13 00:29:50 +00:00
[PATCH] blktrace: cleanup using on_each_cpu
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>
This commit is contained in:
parent
cf342e52e3
commit
4090959aee
@ -476,6 +476,9 @@ static void blk_check_time(unsigned long long *t)
|
|||||||
*t -= (a + b) / 2;
|
*t -= (a + b) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* calibrate our inter-CPU timings
|
||||||
|
*/
|
||||||
static void blk_trace_check_cpu_time(void *data)
|
static void blk_trace_check_cpu_time(void *data)
|
||||||
{
|
{
|
||||||
unsigned long long *t;
|
unsigned long long *t;
|
||||||
@ -493,20 +496,6 @@ static void blk_trace_check_cpu_time(void *data)
|
|||||||
put_cpu();
|
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)
|
static void blk_trace_set_ht_offsets(void)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_SCHED_SMT)
|
#if defined(CONFIG_SCHED_SMT)
|
||||||
@ -535,7 +524,7 @@ static void blk_trace_set_ht_offsets(void)
|
|||||||
static __init int blk_trace_init(void)
|
static __init int blk_trace_init(void)
|
||||||
{
|
{
|
||||||
mutex_init(&blk_tree_mutex);
|
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();
|
blk_trace_set_ht_offsets();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user