From owner-freebsd-hackers Fri Nov 15 9: 3:47 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9466537B401 for ; Fri, 15 Nov 2002 09:03:46 -0800 (PST) Received: from web.cs.ndsu.nodak.edu (web.cs.ndsu.NoDak.edu [134.129.125.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBA4A43E42 for ; Fri, 15 Nov 2002 09:03:45 -0800 (PST) (envelope-from tinguely@web.cs.ndsu.nodak.edu) Received: (from tinguely@localhost) by web.cs.ndsu.nodak.edu (8.11.4/8.11.4) id gAFH3ij16483; Fri, 15 Nov 2002 11:03:44 -0600 (CST) (envelope-from tinguely) Date: Fri, 15 Nov 2002 11:03:44 -0600 (CST) From: mark tinguely Message-Id: <200211151703.gAFH3ij16483@web.cs.ndsu.nodak.edu> To: chuck_tuffli@agilent.com, tinguely@web.cs.ndsu.nodak.edu Subject: Re: bus_dmamem_alloc failing Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: <20021115164813.GB19814@cre85086tuf.rose.agilent.com> 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 > On Fri, Nov 15, 2002 at 10:36:18AM -0600, mark tinguely wrote: > > since the allocated space is larger that a physical page (65536 > 4096), > > bus_dmamem_alloc() allocates physical contiguous memory. After repeated > > allocations and frees, the physical memory pages will fragment and the > > allocation will fail. Chuck Tuffli asks: > When the driver frees the memory with bus_dmamem_free(), can other > drivers or the kernel not use this memory? The memory is avaliable to the kernel/drivers when bus_dmamem_free() is called. The problem for you is that someone else does allocate a page within the 16 page chunk making it unable to reallocatable by you, so the next bus_dmamem_alloc() looks for the next 16 page contiguous chunk. This continues until there is no more 16 page contiguous chunks available and the bus_dmamem_alloc() fails. FreeBSD does not have a physical memory defragmenter. --Mark Tinguely To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message