Date: Wed, 26 Oct 2005 20:01:52 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= <sos@FreeBSD.ORG> To: Jacques Caron <jc@oxado.com> Cc: freebsd-amd64@FreeBSD.ORG Subject: Re: busdma dflt_lock on amd64 > 4 GB Message-ID: <42A1B51D-5A5E-4849-96D0-BC5C2DD1AE97@FreeBSD.ORG> In-Reply-To: <6.2.3.4.0.20051026180325.03ad7558@wheresmymailserver.com> References: <6.2.3.4.0.20051025171333.03a15490@pop.interactivemediafactory.net> <6.2.3.4.0.20051026131012.03a80a20@pop.interactivemediafactory.net> <435F8E06.9060507@samsco.org> <08A81034-AB5D-4BFC-8F53-21501073D674@FreeBSD.ORG> <435FA542.3030209@samsco.org> <6.2.3.4.0.20051026180325.03ad7558@wheresmymailserver.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 26/10/2005, at 18:34, Jacques Caron wrote: > > I've looked around few drivers and there are quite a few different =20 > ways the API is used, and I'm not sure any is "correct" (see the =20 > ALLOCNOW and NO_WAIT used in many places). Having a reference =20 > implementation would be a good thing (tm). > > For instance, some drivers like ata create/allocate/load/whatever =20 > tags and maps for each request, while others prepare some of the =20 > stuff upon attach and only do the minimum at I/O time. That's =20 > probably better in terms of I/O performance but has the drawback =20 > that some memory might be wasted by unused or little-used devices. =20 > I'm sure the "guys who know" have an opinion on which option is =20 > better. OK, lets take this apart for ATA. ATA does all the tag/map creates/allocs/loads for the SGlist and =20 simple workspace stuff at channel attach time, there are NO further =20 creates or allocs after that. So that is exactly what I would expect =20 the ALLOCNOW flags to make busdma support, if that doesn't work =20 busdma needs to be fixed IMNHO. Then when a request is sent to a device the data is =20 bus_dmamap_load'ed into place and unloaded when the resquest =20 finishes. It is not possible to have more than one request running on =20= a channel at a time. This means I have no need for callbacks or anything, and they =20 actually wouldn't bring me anything but increased code complexity =20 which I dont need, in fact dont need at all. I know this might change when tags get official support but it =20 doesn't bring anything but complexity there either (HINT: ATA has a =20 max of 32 tags). Now, bounce buffers might be something entirely different, but I'd =20 expect the system to alloc at least one buffer of maxsize pr tag so =20 it has what it needs if and when. That might be a waste of memory but =20= for ATA its at max 128K pr channel, and that IMNHO is not a problem =20 today.. S=F8ren Schmidt sos@FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42A1B51D-5A5E-4849-96D0-BC5C2DD1AE97>