if: improve accuracy of IOPS computation

This commit is contained in:
Thomas Schoebel-Theuer 2020-08-17 17:04:43 +02:00 committed by Thomas Schoebel-Theuer
parent e59056860f
commit 1238dcaf64
1 changed files with 4 additions and 4 deletions

View File

@ -482,6 +482,7 @@ void if_make_request(struct request_queue *q, struct bio *bio)
int total_len = bio->bi_size;
#endif
// end_remove_this
int kb = (total_len + 512) / 1024;
bool assigned = false;
int error = -EINVAL;
@ -534,11 +535,13 @@ void if_make_request(struct request_queue *q, struct bio *bio)
// throttling of too big write requests
if (rw && if_throttle_start_size > 0) {
int kb = (total_len + 512) / 1024;
if (kb >= if_throttle_start_size)
mars_limit_sleep(&if_throttle, kb);
}
/* gather statistics on IOPS etc */
mars_limit(&brick->io_limiter, kb);
#ifdef DENY_READA // provisinary -- we should introduce an equivalent of READA also to the MARS infrastructure
if (ahead) {
#ifdef CONFIG_MARS_DEBUG
@ -596,9 +599,6 @@ 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