From owner-freebsd-hackers Mon Nov 2 20:47:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA09501 for freebsd-hackers-outgoing; Mon, 2 Nov 1998 20:47:06 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA09495 for ; Mon, 2 Nov 1998 20:47:04 -0800 (PST) (envelope-from xroot@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id UAA10050; Mon, 2 Nov 1998 20:48:22 -0800 (PST) Message-Id: <199811030448.UAA10050@implode.root.com> To: "Larry S. Lile" cc: hackers@FreeBSD.ORG Subject: Re: "panic: free: multiple frees" VM bug? (long) In-reply-to: Your message of "Mon, 02 Nov 1998 23:38:48 EST." From: David Greenman Reply-To: dg@root.com Date: Mon, 02 Nov 1998 20:48:22 -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> 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. contigmalloc() allocates from the kernel_map, so that is what you need to specify to kmem_free(). The offset is just the address that contigmalloc() returned. -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