From ec8cfc02399dbe8d4114cb1addb2a33a5e5e9f6f Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Tue, 19 Jan 2016 10:21:10 +0100 Subject: [PATCH] if: compute rate statistics --- kernel/mars_if.c | 7 ++++--- kernel/mars_if.h | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/mars_if.c b/kernel/mars_if.c index e3b7ba15..d2687aa6 100644 --- a/kernel/mars_if.c +++ b/kernel/mars_if.c @@ -59,7 +59,7 @@ #include #include "mars.h" -#include "lib_limiter.h" +#include "mars_if.h" // remove_this @@ -83,8 +83,6 @@ struct mars_limiter if_throttle = { ///////////////////////// own type definitions //////////////////////// -#include "mars_if.h" - #define IF_HASH_MAX (PAGE_SIZE / sizeof(struct if_hash_anchor)) #define IF_HASH_CHUNK (PAGE_SIZE * 32) @@ -596,6 +594,9 @@ void if_make_request(struct request_queue *q, struct bio *bio) // end_remove_this void *data; + /* gather statistics on IOPS etc */ + mars_limit(&brick->io_limiter, bv_len); + #ifdef ARCH_HAS_KMAP #error FIXME: the current infrastructure cannot deal with HIGHMEM / kmap() #endif diff --git a/kernel/mars_if.h b/kernel/mars_if.h index 9b4115f4..3d1caf43 100644 --- a/kernel/mars_if.h +++ b/kernel/mars_if.h @@ -24,6 +24,8 @@ #ifndef MARS_IF_H #define MARS_IF_H +#include "lib_limiter.h" + #include #define MARS_MAX_SEGMENT_SIZE (PAGE_SIZE) @@ -107,6 +109,7 @@ struct if_brick { // inspectable atomic_t open_count; atomic_t flying_count; + struct mars_limiter io_limiter; // private struct semaphore switch_sem; struct say_channel *say_channel;