diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index 10a2df3fae4c..223d82408dab 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -2749,23 +2749,30 @@ pmap_mincore(pmap, addr) */ if ((*pte & PG_FOW) == 0) val |= MINCORE_MODIFIED|MINCORE_MODIFIED_OTHER; - /* - * Modified by someone - */ - else if (m->dirty || pmap_is_modified(m)) - val |= MINCORE_MODIFIED_OTHER; + else { + /* + * Modified by someone + */ + vm_page_lock_queues(); + if (m->dirty || pmap_is_modified(m)) + val |= MINCORE_MODIFIED_OTHER; + vm_page_unlock_queues(); + } /* * Referenced by us */ if ((*pte & (PG_FOR | PG_FOE)) == 0) val |= MINCORE_REFERENCED|MINCORE_REFERENCED_OTHER; - - /* - * Referenced by someone - */ - else if ((m->flags & PG_REFERENCED) || pmap_ts_referenced(m)) { - val |= MINCORE_REFERENCED_OTHER; - vm_page_flag_set(m, PG_REFERENCED); + else { + /* + * Referenced by someone + */ + vm_page_lock_queues(); + if ((m->flags & PG_REFERENCED) || pmap_ts_referenced(m)) { + val |= MINCORE_REFERENCED_OTHER; + vm_page_flag_set(m, PG_REFERENCED); + } + vm_page_unlock_queues(); } } return val; diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c index f3485437e153..8b0a8c0411a9 100644 --- a/sys/ia64/ia64/pmap.c +++ b/sys/ia64/ia64/pmap.c @@ -2339,23 +2339,30 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr) */ if (pte->pte_d) val |= MINCORE_MODIFIED|MINCORE_MODIFIED_OTHER; - /* - * Modified by someone - */ - else if (pmap_is_modified(m)) - val |= MINCORE_MODIFIED_OTHER; + else { + /* + * Modified by someone + */ + vm_page_lock_queues(); + if (pmap_is_modified(m)) + val |= MINCORE_MODIFIED_OTHER; + vm_page_unlock_queues(); + } /* * Referenced by us */ if (pte->pte_a) val |= MINCORE_REFERENCED|MINCORE_REFERENCED_OTHER; - - /* - * Referenced by someone - */ - else if (pmap_ts_referenced(m)) { - val |= MINCORE_REFERENCED_OTHER; - vm_page_flag_set(m, PG_REFERENCED); + else { + /* + * Referenced by someone + */ + vm_page_lock_queues(); + if (pmap_ts_referenced(m)) { + val |= MINCORE_REFERENCED_OTHER; + vm_page_flag_set(m, PG_REFERENCED); + } + vm_page_unlock_queues(); } } return val;