Date: Fri, 30 Jan 2009 13:29:44 -0600 (CST) From: Mark Tinguely <tinguely@casselton.net> To: arm@freebsd.org, gjb@semihalf.com, tinguely@casselton.net Subject: Re: svn commit: r186730 - in head... Message-ID: <200901301929.n0UJTifW020980@casselton.net> In-Reply-To: <4980356A.4090403@semihalf.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> Mark Tinguely wrote: > > Here is the "svn diff" from a week or so ago. The url is below in case > > the inclusion adds some extra characters. > > > > http://www.casselton.net/~tinguely/arm_pmap_unmanage.diff > > > > Mark, > > I downloaded your patch and applied it (after a few modification to get rid of compile errors). However, when I boot the board with new code it hangs. The problem is with uma allocator for pv_entries. When there is no more entries available it create new ones. It includes mapping memory into kernel using pmap_qenter. And then recurrence starts, pmap_qenter calls pmap_kenter which tries to allocate pv_entry and so on. > I think that pv_entries for pmap_kenter should be allocated from some special pool to avoid this problem. Or some threshold could be set for uma allocator to force allocation of new pv_entries if number of free entries drops below the threshold, but I am not sure if it is possible without extending uma interface. > > Grzesiek I removed the patch at the above address and replaced it with one that stores the KVA in a the vm_page machine dependant variable pv_kva if this is the first mapping of the page. This pv_kva value should be removed anytime the pv_entry is removed. The vast majority of kernel mappings will never be shared, so this should be more effiecient than my earlier patch, and should not have the pv_entry UMA recursion problem. Now, I should also be able to remove the test to see if the pvzone is allocated since those pages are not shared. I also moved some code around to simply the tests and to avoid a potential error that has been in the pmap.c for a long time, but I just noticed it. at line 3431 of revision 184730 in pmap_enter_locked(), the pve could have been freed in the PG_UNMANAGED | PG_FICTITIOUS pages; the KASSERT in line 3429 would not catch the situation. Disclaimer: This is mostly a concept. I ran cc on this file and removed the syntax errors - sorry about that, but haven't gone much further. I will create a cross compiling machine that runs the emulator. --Mark Tinguely.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901301929.n0UJTifW020980>