MFamd64/i386

Add necessary page locking to pmap_mincore().
This commit is contained in:
Alan Cox 2003-09-07 20:02:38 +00:00
parent c8956b36d6
commit 5d314346f5
2 changed files with 38 additions and 24 deletions

View File

@ -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;

View File

@ -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;