public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] blktrace: cleanup using on_each_cpu
@ 2006-08-29 17:46 Martin Peschke
  2006-08-29 17:50 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Peschke @ 2006-08-29 17:46 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Jens Axboe, linux-kernel@vger.kernel.org

This patch kills a few lines of code in blktrace by making use of
on_each_cpu().

Patch against 2.6.18-rc4-mm3.
(Tested with 2.6.17.11, though, as -rc4-mm3 refuses to come up on my
s390 guest.)

Signed-off-by: Martin Peschke <mp3@de.ibm.com>
---

 blktrace.c |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diff -urp a/block/blktrace.c b/block/blktrace.c
--- a/block/blktrace.c	2006-08-29 18:10:51.000000000 +0200
+++ b/block/blktrace.c	2006-08-29 19:00:37.000000000 +0200
@@ -476,6 +476,9 @@ static void blk_check_time(unsigned long
 	*t -= (a + b) / 2;
 }
 
+/*
+ * calibrate our inter-CPU timings
+ */
 static void blk_trace_check_cpu_time(void *data)
 {
 	unsigned long long *t;
@@ -493,20 +496,6 @@ static void blk_trace_check_cpu_time(voi
 	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)
@@ -535,7 +524,7 @@ static void blk_trace_set_ht_offsets(voi
 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;



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-29 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-29 17:46 [Patch] blktrace: cleanup using on_each_cpu Martin Peschke
2006-08-29 17:50 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox