summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-03-09 09:59:48 +0000
committerphk <phk@FreeBSD.org>2003-03-09 09:59:48 +0000
commitd2601e24806f334788c76033d47ff88a171c98d5 (patch)
tree16ef2ef3c0f29079306184a8d59612fd2aa8e4a3 /sys/geom
parentb00bfcca9b33ec7123fb95c16e85a63ad4045151 (diff)
downloadFreeBSD-src-d2601e24806f334788c76033d47ff88a171c98d5.zip
FreeBSD-src-d2601e24806f334788c76033d47ff88a171c98d5.tar.gz
Don't abuse the statistics counters for detecting if we have outstanding
I/O requests, instead use the new dedicated fields in the consumer and provider to track this.
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/geom_io.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index 399df59..b0ab512 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -281,13 +281,15 @@ g_io_request(struct bio *bp, struct g_consumer *cp)
if (g_collectstats) {
binuptime(&bt);
bp->bio_t0 = bt;
- if (cp->stat->nop == cp->stat->nend)
+ if (cp->nstart == cp->nend)
cp->stat->wentbusy = bt; /* Consumer is idle */
- if (pp->stat->nop == pp->stat->nend)
+ if (pp->nstart == pp->nend)
pp->stat->wentbusy = bt; /* Provider is idle */
+ cp->stat->nop++;
+ pp->stat->nop++;
}
- cp->stat->nop++;
- pp->stat->nop++;
+ cp->nstart++;
+ pp->nstart++;
/* Pass it on down. */
g_trace(G_T_BIO, "bio_request(%p) from %p(%s) to %p(%s) cmd %d",
@@ -364,9 +366,11 @@ g_io_deliver(struct bio *bp, int error)
/* Mark the structures as consistent again */
atomic_add_acq_int(&cp->stat->seq1, 1);
atomic_add_acq_int(&pp->stat->seq1, 1);
+ cp->stat->nend++;
+ pp->stat->nend++;
}
- cp->stat->nend++;
- pp->stat->nend++;
+ cp->nend++;
+ pp->nend++;
if (error == ENOMEM) {
printf("ENOMEM %p on %p(%s)\n", bp, pp, pp->name);
OpenPOWER on IntegriCloud