From owner-freebsd-arm@FreeBSD.ORG Fri Jan 30 19:29:46 2009 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05D3010656FD for ; Fri, 30 Jan 2009 19:29:46 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (casselton.net [63.165.140.2]) by mx1.freebsd.org (Postfix) with ESMTP id 92CDF8FC37 for ; Fri, 30 Jan 2009 19:29:45 +0000 (UTC) (envelope-from tinguely@casselton.net) Received: from casselton.net (localhost [127.0.0.1]) by casselton.net (8.14.2/8.14.2) with ESMTP id n0UJTiVY020981; Fri, 30 Jan 2009 13:29:44 -0600 (CST) (envelope-from tinguely@casselton.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=casselton.net; s=ccnMail; t=1233343784; bh=3oPsStkoJ6j5A6+90ZgDM2UQd40KjF33dMASShz YbRE=; h=Date:From:Message-Id:To:Subject:In-Reply-To; b=mr4tXPN4O4L PNzyknb+7XjGU9XGGU9AIX0oaSZnNf6CXKbkEniYU3+7Vm8OhGVpySMw/gACE7FEu+o zxSVGwB9X404SWJQkAb5HopDZU9ImjxWjELf59+tP9ApDSGZyeoBGPljzGmyNHfohyO YjxV1bjWHwHSGPEXSkNC3QBo4k= Received: (from tinguely@localhost) by casselton.net (8.14.2/8.14.2/Submit) id n0UJTifW020980; Fri, 30 Jan 2009 13:29:44 -0600 (CST) (envelope-from tinguely) Date: Fri, 30 Jan 2009 13:29:44 -0600 (CST) From: Mark Tinguely Message-Id: <200901301929.n0UJTifW020980@casselton.net> To: arm@freebsd.org, gjb@semihalf.com, tinguely@casselton.net In-Reply-To: <4980356A.4090403@semihalf.com> Cc: Subject: Re: svn commit: r186730 - in head... X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2009 19:29:46 -0000 > 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.