Subject: Re: uvm_loan() question
To: Jaromr <jdolecek@netbsd.org>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 07/02/2001 07:46:28
hi,

you shouldn't need any explicit unloan step.
just removing the mapping should resolve the loan.
could you send me a dump for the panic?

-Chuck


On Fri, Jun 29, 2001 at 12:33:57AM +0200, Jarom=7Fr Dolecek wrote:
> Hi,
>=20
> I have couple of (supposedly fairly naive) questions.
>=20
> I'd like to know if following is okay (haven't looked yet):
>=20
> 1. allocate kva
> 2. uvm_loan() some pages
> 3. pmap_enter() them to the kva
>=20
> now when we end using the address space,
>=20
> 4. uvm_unloan() the pages
> 5. uvm_km_free() the kva
>=20
> Question one:
> Is it okay to do 4., 5. in this order? (experiment seems to indicate so)
>=20
> Question two:
> Is the step 4. actually necessary ? Would uvm_km_free() "unloan" the
> associated pages for me automatically?
>=20
> I've recently encountered condition in newpipe when uvm_km_free()
> would be called prior to uvm_unloan() of the pages, and that would
> cause a kernel panic. When I call uvm_unloan() and then uvm_km_free()
> for appropriate kva, it seems to work.
>=20
> Jaromir
> --=20
> Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolece=
k/
> NetBSD - just plain best OS! -=3D*=3D- Got spare MCA cards or docs? Hand =
me them!