From d2601e24806f334788c76033d47ff88a171c98d5 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 9 Mar 2003 09:59:48 +0000 Subject: 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. --- sys/geom/geom_io.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'sys/geom/geom_io.c') 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); -- cgit v1.1