From owner-svn-src-all@FreeBSD.ORG Wed Dec 30 17:23:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A0F61065693; Wed, 30 Dec 2009 17:23:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A2DF8FC14; Wed, 30 Dec 2009 17:23:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBUHNRHl065386; Wed, 30 Dec 2009 17:23:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBUHNRKm065384; Wed, 30 Dec 2009 17:23:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912301723.nBUHNRKm065384@svn.freebsd.org> From: Alexander Motin Date: Wed, 30 Dec 2009 17:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201264 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 17:23:28 -0000 Author: mav Date: Wed Dec 30 17:23:27 2009 New Revision: 201264 URL: http://svn.freebsd.org/changeset/base/201264 Log: Call wakeup() only for the first request on the queue. Modified: head/sys/geom/geom_io.c Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Wed Dec 30 17:22:00 2009 (r201263) +++ head/sys/geom/geom_io.c Wed Dec 30 17:23:27 2009 (r201264) @@ -391,6 +391,7 @@ void g_io_request(struct bio *bp, struct g_consumer *cp) { struct g_provider *pp; + int first; KASSERT(cp != NULL, ("NULL cp in g_io_request")); KASSERT(bp != NULL, ("NULL bp in g_io_request")); @@ -463,12 +464,14 @@ g_io_request(struct bio *bp, struct g_co pp->nstart++; cp->nstart++; + first = TAILQ_EMPTY(&g_bio_run_down.bio_queue); TAILQ_INSERT_TAIL(&g_bio_run_down.bio_queue, bp, bio_queue); g_bio_run_down.bio_queue_length++; g_bioq_unlock(&g_bio_run_down); /* Pass it on down. */ - wakeup(&g_wait_down); + if (first) + wakeup(&g_wait_down); } void @@ -476,6 +479,7 @@ g_io_deliver(struct bio *bp, int error) { struct g_consumer *cp; struct g_provider *pp; + int first; KASSERT(bp != NULL, ("NULL bp in g_io_deliver")); pp = bp->bio_to; @@ -536,11 +540,13 @@ g_io_deliver(struct bio *bp, int error) pp->nend++; if (error != ENOMEM) { bp->bio_error = error; + first = TAILQ_EMPTY(&g_bio_run_up.bio_queue); TAILQ_INSERT_TAIL(&g_bio_run_up.bio_queue, bp, bio_queue); bp->bio_flags |= BIO_ONQUEUE; g_bio_run_up.bio_queue_length++; g_bioq_unlock(&g_bio_run_up); - wakeup(&g_wait_up); + if (first) + wakeup(&g_wait_up); return; } g_bioq_unlock(&g_bio_run_up);