From owner-cvs-src@FreeBSD.ORG Mon Oct 10 10:56:37 2005 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2600416A420 for ; Mon, 10 Oct 2005 10:56:37 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id C367D43D58 for ; Mon, 10 Oct 2005 10:56:34 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by zproxy.gmail.com with SMTP id z31so140090nzd for ; Mon, 10 Oct 2005 03:56:34 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=b+0jeYCuvTII4QWV81xgGzIvKTzgtITIHMHDzf3+Kx4z3SSJeUHL2V7FU7ZJTk8MfuTrL4OAc0QxWjXxPwOng8hjEx9c1mm7P1+BOzQ+94CvzxOqJJs52/YFkrgjI0SeEQmGfioqyzt9jZMs4pnrj949OHhpuN6dmjSChLV5xDU= Received: by 10.36.77.15 with SMTP id z15mr4746431nza; Mon, 10 Oct 2005 03:56:34 -0700 (PDT) Received: by 10.36.68.16 with HTTP; Mon, 10 Oct 2005 03:56:34 -0700 (PDT) Message-ID: <34cb7c840510100356t1b93e679v6479afda16277afa@mail.gmail.com> Date: Mon, 10 Oct 2005 11:56:34 +0100 From: Peter Edwards To: Pawel Jakub Dawidek In-Reply-To: <20051010101754.GC3975@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20051010101013.GB3975@garage.freebsd.pl> <13707.1128939139@critter.freebsd.dk> <20051010101754.GC3975@garage.freebsd.pl> Cc: src-committers@freebsd.org, Peter Edwards , cvs-src@freebsd.org, cvs-all@freebsd.org, Poul-Henning Kamp , S?ren Schmidt Subject: Re: cvs commit: src/sys/dev/ata atapi-cd.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2005 10:56:37 -0000 > +> Please see geom_disk.c > > So bascially, you allocate next bio before sending current one? > That's one way of doing it, but I prefer to treat bio allocation as atomi= c > operation, ie. if I cannot allocate all bios, I send no bio down and call > g_io_deliver(parent_bio, ENOMEM) right away. > Do you see any protential problems with doing so? I think an advantage to Poul-Henning's approach is that it reduces latency: the I/O can start immediately, rather than requiring all the bio's to be allocated first. The very fact that the race condition was triggered indicates that the IO devices can overtake the CPU. You might waste some time in the failure case, but that's obviously a small price to pay for improved performance in the normal run of things. This mightn't be important for CD disks, but for something like RAID arrays it might be a different story.