Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2001 12:21:27 -0700 (PDT)
From:      Matt Dillon <dillon@earth.backplane.com>
To:        Thomas Moestl <tmoestl@gmx.net>
Cc:        Patrick Cipiere <Patrick.Cipiere@udcast.com>, tinguely@web.cs.ndsu.nodak.edu, freebsd-hackers@FreeBSD.ORG
Subject:   Re: contigfree, free what?
Message-ID:  <200110121921.f9CJLR035585@earth.backplane.com>
References:  <200110121605.f9CG5F726010@ra.udcast.com> <200110121707.f9CH7Ax34395@earth.backplane.com> <20011012204730.F407@crow.dom2ip.de>

next in thread | previous in thread | raw e-mail | index | archive | help

: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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110121921.f9CJLR035585>