Date: Mon, 2 Nov 1998 23:38:48 -0500 (EST) From: "Larry S. Lile" <lile@stdio.com> To: David Greenman <dg@root.com> Cc: hackers@FreeBSD.ORG Subject: Re: "panic: free: multiple frees" VM bug? (long) Message-ID: <Pine.BSF.3.96.981102233415.18310B-100000@heathers.stdio.com> In-Reply-To: <199811030349.TAA09485@implode.root.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2 Nov 1998, David Greenman wrote: > >I am working on a token ring driver and I cannot seem to find > >out why this is happening. I contigmalloc buffers for tranmsitting > >frames and then free them later when they have been transmitted. > >I have to use contigmalloc in order to get buffers below the > >16M mark for dma. > > > >Anyone see what is wrong? Should I not do this? Or have I > >stumbled over a vm bug? > > > >It looks like a vm bug to me, but I have been wrong before. > > contigmalloc() isn't just a special version of malloc() that allocates > contiguous pages. It's actually a special allocator that has nothing to > do with malloc() and it is thus entirely incorrect to call free() with > a pointer to something that was allocated by contigmalloc(). The proper > way to free stuff that was allocated with contigmalloc() is with kmem_free(). > contigmalloc() is poorly named and should never have been brought into > the kernel that way. >From vm_extern.h void kmem_free __P((vm_map_t, vm_offset_t, vm_size_t)); What would my parameters be? More specifically vm_map? Just an example, I know I will have to write a oltr_free to do free/kmem_free based on how the memory was allocated. Thanks Larry Lile lile@stdio.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.981102233415.18310B-100000>