From 2b2bb92735e1bc2a0f341794b9f1c81f3656b8c0 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Thu, 8 Jul 2010 23:18:56 +0000 Subject: dont count requeued io as outstanding io. there is a 1:1 mapping between calls to bufq_enqueue and bufq_done calls, but bufq_requeue can be called multiple times on an io in between the enqueue and done. if you keep incrementing outstanding you'll never stop sleeping for suspend. bufq_requeue can be called via interrupts, so we cannot sleep there. the problems fixed by this diff were never hit cos the adapters people are testing/running with do not cause bufq_requeue to be called. thanks to thib@ for helping me understand the code better ok thib@ deraadt@ kettenis@ tedu@ --- sys/kern/kern_bufq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'sys') diff --git a/sys/kern/kern_bufq.c b/sys/kern/kern_bufq.c index efd40b7239f..31b69639d15 100644 --- a/sys/kern/kern_bufq.c +++ b/sys/kern/kern_bufq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_bufq.c,v 1.12 2010/07/07 10:50:50 dlg Exp $ */ +/* $OpenBSD: kern_bufq.c,v 1.13 2010/07/08 23:18:55 dlg Exp $ */ /* * Copyright (c) 2010 Thordur I. Bjornsson * @@ -110,9 +110,6 @@ void bufq_requeue(struct bufq *bq, struct buf *bp) { mtx_enter(&bq->bufq_mtx); - while (bq->bufq_stop) { - msleep(&bq->bufq_stop, &bq->bufq_mtx, PRIBIO, "bufqstop", 0); - } bufq_requeuev[bq->bufq_type](bq, bp); mtx_leave(&bq->bufq_mtx); } @@ -202,8 +199,6 @@ bufq_disksort_requeue(struct bufq *bq, struct buf *bp) bufq = (struct buf *)bq->bufq_data; - bq->bufq_outstanding++; - bp->b_bq = bq; bp->b_actf = bufq->b_actf; bufq->b_actf = bp; if (bp->b_actf == NULL) @@ -258,8 +253,6 @@ bufq_fifo_requeue(struct bufq *bq, struct buf *bp) { struct bufq_fifo_head *head = bq->bufq_data; - bq->bufq_outstanding++; - bp->b_bq = bq; SIMPLEQ_INSERT_HEAD(head, bp, b_bufq.bufq_data_fifo.bqf_entries); } -- cgit v1.2.3