From owner-freebsd-hackers Mon Nov 2 21:06:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA12250 for freebsd-hackers-outgoing; Mon, 2 Nov 1998 21:06:33 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA12243 for ; Mon, 2 Nov 1998 21:06:31 -0800 (PST) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id UAA10465; Mon, 2 Nov 1998 20:57:06 -0800 (PST) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpdz10462; Tue Nov 3 04:57:01 1998 Date: Mon, 2 Nov 1998 20:56:38 -0800 (PST) From: Julian Elischer To: David Greenman cc: "Larry S. Lile" , hackers@FreeBSD.ORG Subject: Re: "panic: free: multiple frees" VM bug? (long) In-Reply-To: <199811030349.TAA09485@implode.root.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I also doubt if you really want to free them either.. possibly keep a pool of them and recycle them in your own free list. 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. > > -DG > > David Greenman > Co-founder/Principal Architect, The FreeBSD Project > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message