Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Sep 2012 03:02:21 -0500
From:      Alan Cox <alc@rice.edu>
To:        Aleksandr Rybalko <ray@dlink.ua>
Cc:        "arm@freebsd.org" <arm@freebsd.org>, Alan Cox <alc@rice.edu>
Subject:   Re: armv6 pmap patch
Message-ID:  <5066AB0D.6000901@rice.edu>
In-Reply-To: <20120928160227.99d2b126.ray@dlink.ua>
References:  <504BDC56.3060607@rice.edu> <20120910211817.2d8a340d@fubar.geek.nz> <504E1A1B.90101@rice.edu> <20120928160227.99d2b126.ray@dlink.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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<alc@rice.edu>  wrote:
>
>>> On 09/10/2012 04:18, Andrew Turner wrote:
>>>> On Sat, 08 Sep 2012 19:01:26 -0500
>>>> Alan Cox<alc@rice.edu>   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--



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