diff options
| author | Jeff Roberson <jeff@FreeBSD.org> | 2019-10-15 03:51:46 +0000 |
|---|---|---|
| committer | Jeff Roberson <jeff@FreeBSD.org> | 2019-10-15 03:51:46 +0000 |
| commit | 638f867814a64c3ebbdf7297341e640bff338ed6 (patch) | |
| tree | 8399944de266d957ab3cc0b14d6fb27d20929a98 /sys/mips | |
| parent | fff5403f848ff847aa6bee1155bdc4f99c9053de (diff) | |
Notes
Diffstat (limited to 'sys/mips')
| -rw-r--r-- | sys/mips/mips/pmap.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index 46674851c890..f3a5164bf502 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -2893,14 +2893,9 @@ pmap_remove_write(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_write: page %p is not managed", m)); + vm_page_assert_busied(m); - /* - * If the page is not exclusive busied, then PGA_WRITEABLE cannot be - * set by another thread while the object is locked. Thus, - * if PGA_WRITEABLE is clear, no page table entries need updating. - */ - VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!pmap_page_is_write_mapped(m)) return; rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { @@ -2960,13 +2955,11 @@ pmap_is_modified(vm_page_t m) ("pmap_is_modified: page %p is not managed", m)); /* - * If the page is not exclusive busied, then PGA_WRITEABLE cannot be - * concurrently set while the object is locked. Thus, if PGA_WRITEABLE - * is clear, no PTEs can have PTE_D set. + * If the page is not busied then this check is racy. */ - VM_OBJECT_ASSERT_WLOCKED(m->object); - if (!vm_page_xbusied(m) && (m->aflags & PGA_WRITEABLE) == 0) + if (!pmap_page_is_write_mapped(m)) return (FALSE); + rw_wlock(&pvh_global_lock); rv = pmap_testbit(m, PTE_D); rw_wunlock(&pvh_global_lock); @@ -3101,15 +3094,9 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); VM_OBJECT_ASSERT_WLOCKED(m->object); - KASSERT(!vm_page_xbusied(m), - ("pmap_clear_modify: page %p is exclusive busied", m)); + vm_page_assert_busied(m); - /* - * If the page is not PGA_WRITEABLE, then no PTEs can have PTE_D set. - * If the object containing the page is locked and the page is not - * write busied, then PGA_WRITEABLE cannot be concurrently set. - */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if (!pmap_page_is_write_mapped(m)) return; rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { |
