From owner-freebsd-hackers Fri Nov 15 8:48:48 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 131A137B401 for ; Fri, 15 Nov 2002 08:48:47 -0800 (PST) Received: from msgbas1x.cos.agilent.com (msgbas1x.cos.agilent.com [192.25.240.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6DD3443E75 for ; Fri, 15 Nov 2002 08:48:46 -0800 (PST) (envelope-from ctuffli@rose.agilent.com) Received: from relcos1.cos.agilent.com (relcos1.cos.agilent.com [130.29.152.239]) by msgbas1x.cos.agilent.com (Postfix) with ESMTP id 1CABBBA74 for ; Fri, 15 Nov 2002 09:48:41 -0700 (MST) Received: from rtl.rose.agilent.com (rtl.rose.agilent.com [130.30.179.189]) by relcos1.cos.agilent.com (Postfix) with ESMTP id 8EE9916 for ; Fri, 15 Nov 2002 09:48:40 -0700 (MST) Received: from mail.rose.agilent.com (mailsrv@bellhop [130.30.179.19]) by rtl.rose.agilent.com (8.9.3 (PHNE_18979)/8.9.3 SMKit7.1.0) with ESMTP id IAA22760 for ; Fri, 15 Nov 2002 08:48:39 -0800 (PST) Received: from cre85086tuf (cre85086tuf.rose.agilent.com [130.30.178.1]) by mail.rose.agilent.com (Netscape Messaging Server 3.6) with ESMTP id AAA63A9; Fri, 15 Nov 2002 08:48:36 -0800 Received: by cre85086tuf (Postfix, from userid 1001) id 00B0E19DD76; Fri, 15 Nov 2002 08:48:13 -0800 (PST) Date: Fri, 15 Nov 2002 08:48:13 -0800 From: Chuck Tuffli To: mark tinguely Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: bus_dmamem_alloc failing Message-ID: <20021115164813.GB19814@cre85086tuf.rose.agilent.com> References: <20021115141048.GA367@thegrail.rose.agilent.com> <200211151636.gAFGaIP16259@web.cs.ndsu.nodak.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200211151636.gAFGaIP16259@web.cs.ndsu.nodak.edu> User-Agent: Mutt/1.4i 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. > > You may need to rethink your allocation strategy, such as > hold some memory allocations static between unloads and loads > if your device can take non-physical contiguous memory chunks, > use another allocation technique > or other imaginative tricks. For the final driver, this shouldn't be a big deal. But during my current development while I'm loading/unloading the driver repeatedly, it's a minor pain. Mostly I wanted to see if I was using the bus_*() incorrectly. When the driver frees the memory with bus_dmamem_free(), can other drivers or the kernel not use this memory? -- Chuck Tuffli Agilent Technologies, Storage and Networking To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message