diff options
| author | oster <oster@NetBSD.org> | 2002-09-17 03:43:34 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2002-09-17 03:43:34 +0000 |
| commit | 1b0ab961943ea8a8887871550cb810d45588ecdd (patch) | |
| tree | 185f6ccb54c3a9876b2b458a897355987f94569c /sys/dev/raidframe | |
| parent | aad979b7ebc0cda3c01ba26ebd1434c73eeb4825 (diff) | |
Introduce and use RF_DEBUG_QUEUE (for debugging the various queueing
types available in RAIDframe).
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_archs.h | 6 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_fifo.c | 8 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_sstf.c | 22 |
3 files changed, 31 insertions, 5 deletions
diff --git a/sys/dev/raidframe/rf_archs.h b/sys/dev/raidframe/rf_archs.h index a6f6ad06e40..c9f2251d211 100644 --- a/sys/dev/raidframe/rf_archs.h +++ b/sys/dev/raidframe/rf_archs.h @@ -1,4 +1,4 @@ -/* $NetBSD: rf_archs.h,v 1.16 2002/09/17 03:21:41 oster Exp $ */ +/* $NetBSD: rf_archs.h,v 1.17 2002/09/17 03:43:34 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -124,6 +124,10 @@ #define RF_DEBUG_VERIFYPARITY 0 #endif +#ifndef RF_DEBUG_QUEUE +#define RF_DEBUG_QUEUE 0 +#endif + #include "rf_options.h" #endif /* !_RF__RF_ARCHS_H_ */ diff --git a/sys/dev/raidframe/rf_fifo.c b/sys/dev/raidframe/rf_fifo.c index 45c732af155..7c6a28c4f98 100644 --- a/sys/dev/raidframe/rf_fifo.c +++ b/sys/dev/raidframe/rf_fifo.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_fifo.c,v 1.7 2001/11/13 07:11:14 lukem Exp $ */ +/* $NetBSD: rf_fifo.c,v 1.8 2002/09/17 03:43:34 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -36,7 +36,7 @@ ***************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_fifo.c,v 1.7 2001/11/13 07:11:14 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_fifo.c,v 1.8 2002/09/17 03:43:34 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -88,10 +88,12 @@ rf_FifoEnqueue(q_in, elem, priority) q->hq_count++; } else { RF_ASSERT(elem->next == NULL); +#if RF_DEBUG_QUEUE if (rf_fifoDebug) { printf("raid%d: fifo: ENQ lopri\n", elem->raidPtr->raidid); } +#endif if (!q->lq_tail) { RF_ASSERT(q->lq_count == 0 && q->lq_head == NULL); q->lq_head = q->lq_tail = elem; @@ -139,10 +141,12 @@ rf_FifoDequeue(q_in) q->lq_tail = NULL; nd->next = NULL; q->lq_count--; +#if RF_DEBUG_QUEUE if (rf_fifoDebug) { printf("raid%d: fifo: DEQ lopri %lx\n", nd->raidPtr->raidid, (long) nd); } +#endif } else { RF_ASSERT(q->hq_count == 0 && q->lq_count == 0 && q->hq_tail == NULL && q->lq_tail == NULL); nd = NULL; diff --git a/sys/dev/raidframe/rf_sstf.c b/sys/dev/raidframe/rf_sstf.c index 648d666a1ec..75eb1537023 100644 --- a/sys/dev/raidframe/rf_sstf.c +++ b/sys/dev/raidframe/rf_sstf.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_sstf.c,v 1.8 2001/11/13 07:11:17 lukem Exp $ */ +/* $NetBSD: rf_sstf.c,v 1.9 2002/09/17 03:43:34 oster Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -33,7 +33,7 @@ ******************************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_sstf.c,v 1.8 2001/11/13 07:11:17 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_sstf.c,v 1.9 2002/09/17 03:43:34 oster Exp $"); #include <dev/raidframe/raidframevar.h> @@ -297,6 +297,7 @@ rf_SstfEnqueue(qptr, req, priority) sstfq = (RF_Sstf_t *) qptr; if (priority == RF_IO_LOW_PRIORITY) { +#if RF_DEBUG_QUEUE if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) { RF_DiskQueue_t *dq; dq = (RF_DiskQueue_t *) req->queue; @@ -306,6 +307,7 @@ rf_SstfEnqueue(qptr, req, priority) sstfq->left.qlen, sstfq->right.qlen, sstfq->lopri.qlen); } +#endif do_sstf_ord_q(&sstfq->lopri.queue, &sstfq->lopri.qtail, req); sstfq->lopri.qlen++; } else { @@ -326,9 +328,11 @@ do_dequeue(queue, req) { RF_DiskQueueData_t *req2; +#if RF_DEBUG_QUEUE if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) { printf("raid%d: do_dequeue\n", req->raidPtr->raidid); } +#endif if (req == queue->queue) { DO_HEAD_DEQ(req2, queue); RF_ASSERT(req2 == req); @@ -356,6 +360,7 @@ rf_SstfDequeue(qptr) sstfq = (RF_Sstf_t *) qptr; +#if RF_DEBUG_QUEUE if (rf_sstfDebug) { RF_DiskQueue_t *dq; dq = (RF_DiskQueue_t *) req->queue; @@ -364,6 +369,7 @@ rf_SstfDequeue(qptr) req->raidPtr->raidid, dq->row, dq->col, sstfq->left.qlen, sstfq->right.qlen, sstfq->lopri.qlen); } +#endif if (sstfq->left.queue == NULL) { RF_ASSERT(sstfq->left.qlen == 0); if (sstfq->right.queue == NULL) { @@ -372,16 +378,20 @@ rf_SstfDequeue(qptr) RF_ASSERT(sstfq->lopri.qlen == 0); return (NULL); } +#if RF_DEBUG_QUEUE if (rf_sstfDebug) { printf("raid%d: sstf: check for close lopri", req->raidPtr->raidid); } +#endif req = closest_to_arm(&sstfq->lopri, sstfq->last_sector, &sstfq->dir, sstfq->allow_reverse); +#if RF_DEBUG_QUEUE if (rf_sstfDebug) { printf("raid%d: sstf: closest_to_arm said %lx", req->raidPtr->raidid, (long) req); } +#endif if (req == NULL) return (NULL); do_dequeue(&sstfq->lopri, req); @@ -415,6 +425,7 @@ rf_ScanDequeue(qptr) scanq = (RF_Sstf_t *) qptr; +#if RF_DEBUG_QUEUE if (rf_scanDebug) { RF_DiskQueue_t *dq; dq = (RF_DiskQueue_t *) req->queue; @@ -423,6 +434,7 @@ rf_ScanDequeue(qptr) req->raidPtr->raidid, dq->row, dq->col, scanq->left.qlen, scanq->right.qlen, scanq->lopri.qlen); } +#endif if (scanq->left.queue == NULL) { RF_ASSERT(scanq->left.qlen == 0); if (scanq->right.queue == NULL) { @@ -470,6 +482,7 @@ rf_CscanDequeue(qptr) cscanq = (RF_Sstf_t *) qptr; RF_ASSERT(cscanq->dir == DIR_RIGHT); +#if RF_DEBUG_QUEUE if (rf_cscanDebug) { RF_DiskQueue_t *dq; dq = (RF_DiskQueue_t *) req->queue; @@ -479,6 +492,7 @@ rf_CscanDequeue(qptr) cscanq->left.qlen, cscanq->right.qlen, cscanq->lopri.qlen); } +#endif if (cscanq->right.queue) { DO_HEAD_DEQ(req, &cscanq->right); } else { @@ -639,10 +653,12 @@ rf_SstfPromote(qptr, parityStripeID, which_ru) n = 0; for (r = sstfq->lopri.queue; r; r = next) { next = r->next; +#if RF_DEBUG_QUEUE if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) { printf("raid%d: check promote %lx\n", r->raidPtr->raidid, (long) r); } +#endif if ((r->parityStripeID == parityStripeID) && (r->which_ru == which_ru)) { do_dequeue(&sstfq->lopri, r); @@ -650,10 +666,12 @@ rf_SstfPromote(qptr, parityStripeID, which_ru) n++; } } +#if RF_DEBUG_QUEUE if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) { printf("raid%d: promoted %d matching I/Os queues are %d,%d,%d\n", r->raidPtr->raidid, n, sstfq->left.qlen, sstfq->right.qlen, sstfq->lopri.qlen); } +#endif return (n); } |
