Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Oct 2005 11:56:34 +0100
From:      Peter Edwards <peadar.edwards@gmail.com>
To:        Pawel Jakub Dawidek <pjd@freebsd.org>
Cc:        src-committers@freebsd.org, Peter Edwards <peadar@freebsd.org>, cvs-src@freebsd.org, cvs-all@freebsd.org, Poul-Henning Kamp <phk@phk.freebsd.dk>, S?ren Schmidt <sos@freebsd.org>
Subject:   Re: cvs commit: src/sys/dev/ata atapi-cd.c
Message-ID:  <34cb7c840510100356t1b93e679v6479afda16277afa@mail.gmail.com>
In-Reply-To: <20051010101754.GC3975@garage.freebsd.pl>
References:  <20051010101013.GB3975@garage.freebsd.pl> <13707.1128939139@critter.freebsd.dk> <20051010101754.GC3975@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
> +> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34cb7c840510100356t1b93e679v6479afda16277afa>