Introduce pmap_enter_locked() and use it to reimplement pmap_enter_quick().
Tested by: cognet@
This commit is contained in:
parent
f3b90d48bb
commit
d49e4d3f55
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=159127
@ -198,6 +198,8 @@ extern struct pv_addr systempage;
|
|||||||
static void pmap_free_pv_entry (pv_entry_t);
|
static void pmap_free_pv_entry (pv_entry_t);
|
||||||
static pv_entry_t pmap_get_pv_entry(void);
|
static pv_entry_t pmap_get_pv_entry(void);
|
||||||
|
|
||||||
|
static void pmap_enter_locked(pmap_t, vm_offset_t, vm_page_t,
|
||||||
|
vm_prot_t, boolean_t);
|
||||||
static void pmap_vac_me_harder(struct vm_page *, pmap_t,
|
static void pmap_vac_me_harder(struct vm_page *, pmap_t,
|
||||||
vm_offset_t);
|
vm_offset_t);
|
||||||
static void pmap_vac_me_kpmap(struct vm_page *, pmap_t,
|
static void pmap_vac_me_kpmap(struct vm_page *, pmap_t,
|
||||||
@ -3337,6 +3339,19 @@ void
|
|||||||
pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
||||||
boolean_t wired)
|
boolean_t wired)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
vm_page_lock_queues();
|
||||||
|
pmap_enter_locked(pmap, va, m, prot, wired);
|
||||||
|
vm_page_unlock_queues();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The page queues and pmap must be locked.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
||||||
|
boolean_t wired)
|
||||||
|
{
|
||||||
struct l2_bucket *l2b = NULL;
|
struct l2_bucket *l2b = NULL;
|
||||||
struct vm_page *opg;
|
struct vm_page *opg;
|
||||||
struct pv_entry *pve = NULL;
|
struct pv_entry *pve = NULL;
|
||||||
@ -3345,7 +3360,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
|||||||
u_int oflags;
|
u_int oflags;
|
||||||
vm_paddr_t pa;
|
vm_paddr_t pa;
|
||||||
|
|
||||||
vm_page_lock_queues();
|
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
|
||||||
if (va == vector_page) {
|
if (va == vector_page) {
|
||||||
pa = systempage.pv_pa;
|
pa = systempage.pv_pa;
|
||||||
m = NULL;
|
m = NULL;
|
||||||
@ -3561,7 +3576,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
|||||||
if (m)
|
if (m)
|
||||||
pmap_vac_me_harder(m, pmap, va);
|
pmap_vac_me_harder(m, pmap, va);
|
||||||
}
|
}
|
||||||
vm_page_unlock_queues();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3578,15 +3592,9 @@ pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
|||||||
vm_page_t mpte)
|
vm_page_t mpte)
|
||||||
{
|
{
|
||||||
|
|
||||||
vm_page_busy(m);
|
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
|
||||||
vm_page_unlock_queues();
|
pmap_enter_locked(pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE),
|
||||||
VM_OBJECT_UNLOCK(m->object);
|
FALSE);
|
||||||
mtx_lock(&Giant);
|
|
||||||
pmap_enter(pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE);
|
|
||||||
mtx_unlock(&Giant);
|
|
||||||
VM_OBJECT_LOCK(m->object);
|
|
||||||
vm_page_lock_queues();
|
|
||||||
vm_page_wakeup(m);
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user