From owner-freebsd-hackers Mon Jan 14 14: 1:32 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from aslan.scsiguy.com (aslan.scsiguy.com [63.229.232.106]) by hub.freebsd.org (Postfix) with ESMTP id 4674137B41E for ; Mon, 14 Jan 2002 14:01:23 -0800 (PST) Received: from scsiguy.com (localhost [127.0.0.1]) by aslan.scsiguy.com (8.11.5/8.11.5) with ESMTP id g0EM1Hg31707; Mon, 14 Jan 2002 15:01:17 -0700 (MST) (envelope-from gibbs@scsiguy.com) Message-Id: <200201142201.g0EM1Hg31707@aslan.scsiguy.com> To: =?ISO-8859-1?Q?G=E9rard_Roudier?= Cc: Phungte Ha , hackers@FreeBSD.ORG Subject: Re: bus_dmamap_load change request. In-Reply-To: Your message of "Mon, 14 Jan 2002 22:45:23 +0100." <20020114222148.X2771-100000@gerard> Date: Mon, 14 Jan 2002 15:01:17 -0700 From: "Justin T. Gibbs" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >> I changed the code locally a while back to allocate the table during >> the allocation of the dma tag. This seems to work, but I just haven't >> gotten back to it to think through all of the consequences. Whatever >> the solution, we don't want to device a solution where most drivers >> have allocated 2X their required S/G list size. > >Most other O/Ses seem to pay for the dmamap abstraction this 100% >allocation overcost. This is indeed a pity for >95% of systems currently >using FreeBSD (IA32) that donnot actually require such overallocation. There is only 1 tag to several maps. If you allocate one extra S/G list per-tag, then your "overallocation" is 1/nmaps. The current scheme using the stack gives 0 over allocation, but isn't too nice for other reasons. I also don't completely understand your claim that overallocation is not required for IA32. Is this because you feel the driver should do the mapping loop and store the results into its own, taylored to its dma engine, structure? It is hard to find a mapping abstraction that avoids a conversion. >What about supplying several dmamap (create/load/...) methods, for >example: > >1) A one shot load method for reasonnable known map size that does > not overallocate if not required by arch. (the one we have) > >2) A one shot method that may overallocate depending on arch and/or map > size (may use method #1 when possible). > >3) A multi-shot method that may not overallocate if not needed for arch. > By multishot, I mean the callback may be called several times with > partial map + some more flag. The question for all of these methods is, "where is the mapping list stored?" That would help me understand your proposal. -- Justin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message