From owner-freebsd-arm@FreeBSD.ORG Sat Sep 29 08:02:24 2012 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 0A3BF106564A for ; Sat, 29 Sep 2012 08:02:24 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh10.mail.rice.edu (mh10.mail.rice.edu [128.42.201.30]) by mx1.freebsd.org (Postfix) with ESMTP id C75AC8FC0A for ; Sat, 29 Sep 2012 08:02:23 +0000 (UTC) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 15BA4604EE; Sat, 29 Sep 2012 03:02:23 -0500 (CDT) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 14373604E9; Sat, 29 Sep 2012 03:02:23 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh10.mail.rice.edu, auth channel Received: from mh10.mail.rice.edu ([127.0.0.1]) by mh10.mail.rice.edu (mh10.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id yVPNt1nKAu53; Sat, 29 Sep 2012 03:02:22 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh10.mail.rice.edu (Postfix) with ESMTPSA id A0182604D6; Sat, 29 Sep 2012 03:02:22 -0500 (CDT) Message-ID: <5066AB0D.6000901@rice.edu> Date: Sat, 29 Sep 2012 03:02:21 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Aleksandr Rybalko References: <504BDC56.3060607@rice.edu> <20120910211817.2d8a340d@fubar.geek.nz> <504E1A1B.90101@rice.edu> <20120928160227.99d2b126.ray@dlink.ua> In-Reply-To: <20120928160227.99d2b126.ray@dlink.ua> Content-Type: multipart/mixed; boundary="------------090002000604010006090901" Cc: "arm@freebsd.org" , Alan Cox Subject: Re: armv6 pmap patch 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: Sat, 29 Sep 2012 08:02:24 -0000 This is a multi-part message in MIME format. --------------090002000604010006090901 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 09/28/2012 08:02, Aleksandr Rybalko wrote: > On Mon, 10 Sep 2012 11:49:31 -0500 > Alan Cox wrote: > >>> On 09/10/2012 04:18, Andrew Turner wrote: >>>> On Sat, 08 Sep 2012 19:01:26 -0500 >>>> Alan Cox wrote: >>>> >>>>> Can someone here please test this patch to the new armv6 pmap? It >>>>> eliminates the use of the page queues lock and updates some >>>>> comments. Similar changes were recently made to the original arm >>>>> pmap. >>>>> >>>>> Thanks, >>>>> Alan >>>>> >>>> I have booted FreeBSD with the patch on a Pandaboard and it >>>> appears to work. Are there any tests you would like me to run? >>>> >>> Nothing in particular, since almost anything that you do on the >>> machine will exercise the changed code. >>> >>> There appears to be a lot of unnecessary dropping and reacquiring of >>> locks around UMA calls in both pmap.c and pmap-v6.c. I will try to >>> generate a patch to eliminate this later in the week. >>> >>> Alan >>> > Hi Alan and ARM hackers, > > Don't know exact, but think it is related to current pmap work. > So here is two panics observed on R-Pi recently (HEAD @r240985), both > on attempt to untar ports.tar.gz :) > *snip* The attached patch should eliminate the panic. Please let me know when you've had a chance to test it. Alan --------------090002000604010006090901 Content-Type: text/plain; name="armv6-pmap7.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="armv6-pmap7.patch" Index: arm/arm/pmap-v6.c =================================================================== --- arm/arm/pmap-v6.c (revision 241020) +++ arm/arm/pmap-v6.c (working copy) @@ -2316,7 +2316,6 @@ pmap_remove_all(vm_page_t m) if (TAILQ_EMPTY(&m->md.pv_list)) return; rw_wlock(&pvh_global_lock); - pmap_remove_write(m); curpm = vmspace_pmap(curproc->p_vmspace); while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { if (flush == FALSE && (pv->pv_pmap == curpm || @@ -2327,6 +2326,8 @@ pmap_remove_all(vm_page_t m) l2b = pmap_get_l2_bucket(pv->pv_pmap, pv->pv_va); KASSERT(l2b != NULL, ("No l2 bucket")); ptep = &l2b->l2b_kva[l2pte_index(pv->pv_va)]; + if (L2_S_WRITABLE(*ptep)) + vm_page_dirty(m); *ptep = 0; if (pmap_is_current(pv->pv_pmap)) PTE_SYNC(ptep); @@ -2337,6 +2338,7 @@ pmap_remove_all(vm_page_t m) PMAP_UNLOCK(pv->pv_pmap); pmap_free_pv_entry(pv); } + m->md.pvh_attrs &= ~(PVF_MOD | PVF_REF); if (flush) { if (PV_BEEN_EXECD(flags)) --------------090002000604010006090901--