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/sparc64/sparc64 | |
parent | fff5403f848ff847aa6bee1155bdc4f99c9053de (diff) | |
download | src-638f867814a64c3ebbdf7297341e640bff338ed6.tar.gz src-638f867814a64c3ebbdf7297341e640bff338ed6.zip |
(6/6) Convert pmap to expect busy in write related operations now that all
callers hold it.
This simplifies pmap code and removes a dependency on the object lock.
Reviewed by: kib, markj
Tested by: pho
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21596
Notes
Notes:
svn path=/head/; revision=353541
Diffstat (limited to 'sys/sparc64/sparc64')
-rw-r--r-- | sys/sparc64/sparc64/pmap.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c index d485344230a3..5a2511779140 100644 --- a/sys/sparc64/sparc64/pmap.c +++ b/sys/sparc64/sparc64/pmap.c @@ -2116,12 +2116,9 @@ pmap_is_modified(vm_page_t m) rv = FALSE; /* - * 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 TTEs can have TD_W 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 (rv); rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { @@ -2195,17 +2192,11 @@ 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 TTEs can have TD_W set. - * If the object containing the page is locked and the page is not - * exclusive busied, then PGA_WRITEABLE cannot be concurrently set. - */ - if ((m->aflags & PGA_WRITEABLE) == 0) + if (!pmap_page_is_write_mapped(m)) return; + rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { if ((tp->tte_data & TD_PV) == 0) @@ -2225,15 +2216,11 @@ 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 (!pmap_page_is_write_mapped(m)) + return; - /* - * 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) - return; rw_wlock(&tte_list_global_lock); TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) { if ((tp->tte_data & TD_PV) == 0) |