if: compute rate statistics

This commit is contained in:
Thomas Schoebel-Theuer 2016-01-19 10:21:10 +01:00 committed by Thomas Schoebel-Theuer
parent 628c636dff
commit ec8cfc0239
2 changed files with 7 additions and 3 deletions

View File

@ -59,7 +59,7 @@
#include <linux/blkdev.h>
#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

View File

@ -24,6 +24,8 @@
#ifndef MARS_IF_H
#define MARS_IF_H
#include "lib_limiter.h"
#include <linux/semaphore.h>
#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;