kernel - Acquire vm_token in pmap_remove_all()
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 5 Oct 2012 04:14:32 +0000 (21:14 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 5 Oct 2012 04:14:32 +0000 (21:14 -0700)
* Kitchen sink try to fix the wire_count panic, acquire vm_token
  in pmap_remove_all().

sys/platform/pc32/i386/pmap.c

index d60cabd..9d6c89c 100644 (file)
@@ -2053,7 +2053,10 @@ pmap_remove_all(vm_page_t m)
 
        if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
                return;
 
        if (!pmap_initialized || (m->flags & PG_FICTITIOUS))
                return;
+       if (TAILQ_EMPTY(&m->md.pv_list))
+               return;
 
 
+       lwkt_getoken(&vm_token);
        pmap_inval_init(&info);
        while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) {
                pmap = pv->pv_pmap;
        pmap_inval_init(&info);
        while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) {
                pmap = pv->pv_pmap;
@@ -2105,6 +2108,7 @@ pmap_remove_all(vm_page_t m)
        }
        KKASSERT((m->flags & (PG_MAPPED|PG_WRITEABLE)) == 0);
        pmap_inval_done(&info);
        }
        KKASSERT((m->flags & (PG_MAPPED|PG_WRITEABLE)) == 0);
        pmap_inval_done(&info);
+       lwkt_reloken(&vm_token);
 }
 
 /*
 }
 
 /*