summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/primary.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-05-23 21:15:19 +0000
committerpjd <pjd@FreeBSD.org>2011-05-23 21:15:19 +0000
commit42a14e17b5ae3fb20e7c5cba42663f088ae9fa19 (patch)
tree8bdba7aed6120f1649d55702a6e914918cfa0c9c /sbin/hastd/primary.c
parentbef2f8f5d1658b0cc6ec6bbe5c1b792020c86ee9 (diff)
downloadFreeBSD-src-42a14e17b5ae3fb20e7c5cba42663f088ae9fa19.zip
FreeBSD-src-42a14e17b5ae3fb20e7c5cba42663f088ae9fa19.tar.gz
Keep statistics on number of BIO_READ, BIO_WRITE, BIO_DELETE and BIO_FLUSH
requests as well as number of activemap updates. Number of BIO_WRITEs and activemap updates are especially interesting, because if those two are too close to each other, it means that your workload needs bigger number of dirty extents. Activemap should be updated as rarely as possible. MFC after: 1 week
Diffstat (limited to 'sbin/hastd/primary.c')
-rw-r--r--sbin/hastd/primary.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c
index d8eb664..1f6585c 100644
--- a/sbin/hastd/primary.c
+++ b/sbin/hastd/primary.c
@@ -1117,6 +1117,7 @@ ggate_recv_thread(void *arg)
*/
switch (ggio->gctl_cmd) {
case BIO_READ:
+ res->hr_stat_read++;
pjdlog_debug(2,
"ggate_recv: (%p) Moving request to the send queue.",
hio);
@@ -1145,6 +1146,7 @@ ggate_recv_thread(void *arg)
QUEUE_INSERT1(hio, send, ncomp);
break;
case BIO_WRITE:
+ res->hr_stat_write++;
if (res->hr_resuid == 0) {
/*
* This is first write, initialize localcnt and
@@ -1183,12 +1185,21 @@ ggate_recv_thread(void *arg)
mtx_lock(&res->hr_amp_lock);
if (activemap_write_start(res->hr_amp,
ggio->gctl_offset, ggio->gctl_length)) {
+ res->hr_stat_activemap_update++;
(void)hast_activemap_flush(res);
}
mtx_unlock(&res->hr_amp_lock);
/* FALLTHROUGH */
case BIO_DELETE:
case BIO_FLUSH:
+ switch (ggio->gctl_cmd) {
+ case BIO_DELETE:
+ res->hr_stat_delete++;
+ break;
+ case BIO_FLUSH:
+ res->hr_stat_flush++;
+ break;
+ }
pjdlog_debug(2,
"ggate_recv: (%p) Moving request to the send queues.",
hio);
OpenPOWER on IntegriCloud