armv6 pmap patch
Alan Cox
alc at rice.edu
Sat Sep 29 08:02:24 UTC 2012
On 09/28/2012 08:02, Aleksandr Rybalko wrote:
> On Mon, 10 Sep 2012 11:49:31 -0500
> Alan Cox<alc at rice.edu> wrote:
>
>>> On 09/10/2012 04:18, Andrew Turner wrote:
>>>> On Sat, 08 Sep 2012 19:01:26 -0500
>>>> Alan Cox<alc at 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
-------------- next part --------------
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))
More information about the freebsd-arm
mailing list