From owner-cvs-all@FreeBSD.ORG Mon Oct 10 14:58:17 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F9A916A41F; Mon, 10 Oct 2005 14:58:17 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37B6543D45; Mon, 10 Oct 2005 14:58:15 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.11] (junior.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id j9AEwDhE043780; Mon, 10 Oct 2005 08:58:13 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <434A818D.3010100@samsco.org> Date: Mon, 10 Oct 2005 08:58:21 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050615 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <20051010101013.GB3975@garage.freebsd.pl> <13707.1128939139@critter.freebsd.dk> <20051010101754.GC3975@garage.freebsd.pl> In-Reply-To: <20051010101754.GC3975@garage.freebsd.pl> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on pooker.samsco.org 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2005 14:58:17 -0000 Pawel Jakub Dawidek wrote: > On Mon, Oct 10, 2005 at 12:12:19PM +0200, Poul-Henning Kamp wrote: > +> In message <20051010101013.GB3975@garage.freebsd.pl>, Pawel Jakub Dawidek write > +> s: > +> > > +> >On Mon, Oct 10, 2005 at 11:06:49AM +0200, S?ren Schmidt wrote: > +> >+> On 09/10/2005, at 23:11, Peter Edwards wrote: > +> >+> > +> >+> Why did you ask me to review this when you just committed it anyway ? > +> >+> > +> >+> As I said I'm not sure this is the right way to fix this.. > +> > > +> >It seems to be right. I do it in my GEOM classes to handle g_clone_bio() > +> >failures better. So the only objection I may have is that it could be > +> >done a bit cleaner: > +> > +> 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 atomic > 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? > There are pros and cons, and Poul-Henning and I have been discussing something related to this recently. The problem is that bio's get allocated from UMA. If there is a severe shortage of memory, you might not be able to allocate enough bio's through the GEOM stack to do I/O, but you need to do I/O in order to free up memory. Trying to allocate all bio's at the beginning of the transaction doesn't solve this, while recycling them one at a time can help significantly. It's still not a total solution, though. Granted, this doesn't apply to the case of a CD driver, but it's good to consider all of the cases and try for a general solution. Scott