From owner-freebsd-hackers Fri Oct 12 12:21:33 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 4158137B406 for ; Fri, 12 Oct 2001 12:21:30 -0700 (PDT) Received: (from dillon@localhost) by earth.backplane.com (8.11.6/8.11.2) id f9CJLR035585; Fri, 12 Oct 2001 12:21:27 -0700 (PDT) (envelope-from dillon) Date: Fri, 12 Oct 2001 12:21:27 -0700 (PDT) From: Matt Dillon Message-Id: <200110121921.f9CJLR035585@earth.backplane.com> To: Thomas Moestl Cc: Patrick Cipiere , tinguely@web.cs.ndsu.nodak.edu, freebsd-hackers@FreeBSD.ORG Subject: Re: contigfree, free what? References: <200110121605.f9CG5F726010@ra.udcast.com> <200110121707.f9CH7Ax34395@earth.backplane.com> <20011012204730.F407@crow.dom2ip.de> 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 :I have also looked into this a while ago, but got stuck at some :point. I have just looked at it again, and I think I have found a solution. : :... : :This is probably because the map entries do have a NULL object :pointer. vm_map_pageable() calls vm_fault_wire(), so this will fail. : :I have attached a patch which works for me. It duplicates most of the :logic of kmem_alloc in that it calls vm_map_findspace() first, then :vm_map_insert() (which basically is what is done in :kmem_alloc_pageable() too, but here, kernel_object is passed instead :of a NULL pointer, so that the map entry will have a valid object :pointer). Then, the pages are inserted into the object as before, and :finally, the map entries are marked as wired by using :vm_map_pageable(). Because this will also call vm_fault_wire(), which :will among other things do a vm_page_wire(), contigmalloc does not :need to wire the pages itself. : :The pmap_kenter() calls can also be reomved, since the pages will be :mapped in any case by vm_fault(). : : - thomas Ach, of course. I see what's happening now! Thomas, your patch looks good! I'm going to patch it in and test it a bit. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message