Prepare better for multi-platform by eliminating another required
pmap routine (pmap_is_referenced.) Upper level recoded to use pmap_ts_referenced.
This commit is contained in:
parent
6acc486b3f
commit
9b5a5d81be
@ -39,7 +39,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
|
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
|
||||||
* $Id: pmap.c,v 1.131 1996/11/11 04:20:19 dyson Exp $
|
* $Id: pmap.c,v 1.132 1996/12/29 02:27:07 dyson Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2788,51 +2788,6 @@ pmap_phys_address(ppn)
|
|||||||
return (i386_ptob(ppn));
|
return (i386_ptob(ppn));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* pmap_is_referenced:
|
|
||||||
*
|
|
||||||
* Return whether or not the specified physical page was referenced
|
|
||||||
* by any physical maps.
|
|
||||||
*/
|
|
||||||
boolean_t
|
|
||||||
pmap_is_referenced(vm_offset_t pa)
|
|
||||||
{
|
|
||||||
register pv_entry_t pv;
|
|
||||||
pv_table_t *ppv;
|
|
||||||
unsigned *pte;
|
|
||||||
int s;
|
|
||||||
|
|
||||||
if (!pmap_is_managed(pa))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
ppv = pa_to_pvh(pa);
|
|
||||||
|
|
||||||
s = splvm();
|
|
||||||
/*
|
|
||||||
* Not found, check current mappings returning immediately if found.
|
|
||||||
*/
|
|
||||||
for (pv = TAILQ_FIRST(&ppv->pv_list);
|
|
||||||
pv;
|
|
||||||
pv = TAILQ_NEXT(pv, pv_list)) {
|
|
||||||
|
|
||||||
/*
|
|
||||||
* if the bit being tested is the modified bit, then
|
|
||||||
* mark clean_map and ptes as never
|
|
||||||
* modified.
|
|
||||||
*/
|
|
||||||
if (!pmap_track_modified(pv->pv_va))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
pte = pmap_pte_quick(pv->pv_pmap, pv->pv_va);
|
|
||||||
if ((int) *pte & PG_A) {
|
|
||||||
splx(s);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
splx(s);
|
|
||||||
return (FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pmap_ts_referenced:
|
* pmap_ts_referenced:
|
||||||
*
|
*
|
||||||
@ -3031,8 +2986,10 @@ pmap_mincore(pmap, addr)
|
|||||||
* Referenced by someone
|
* Referenced by someone
|
||||||
*/
|
*/
|
||||||
else if ((PHYS_TO_VM_PAGE(pa)->flags & PG_REFERENCED) ||
|
else if ((PHYS_TO_VM_PAGE(pa)->flags & PG_REFERENCED) ||
|
||||||
pmap_is_referenced(pa))
|
pmap_ts_referenced(pa)) {
|
||||||
val |= MINCORE_REFERENCED_OTHER;
|
val |= MINCORE_REFERENCED_OTHER;
|
||||||
|
PHYS_TO_VM_PAGE(pa)->flags |= PG_REFERENCED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
|
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
|
||||||
* $Id: pmap.c,v 1.131 1996/11/11 04:20:19 dyson Exp $
|
* $Id: pmap.c,v 1.132 1996/12/29 02:27:07 dyson Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2788,51 +2788,6 @@ pmap_phys_address(ppn)
|
|||||||
return (i386_ptob(ppn));
|
return (i386_ptob(ppn));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* pmap_is_referenced:
|
|
||||||
*
|
|
||||||
* Return whether or not the specified physical page was referenced
|
|
||||||
* by any physical maps.
|
|
||||||
*/
|
|
||||||
boolean_t
|
|
||||||
pmap_is_referenced(vm_offset_t pa)
|
|
||||||
{
|
|
||||||
register pv_entry_t pv;
|
|
||||||
pv_table_t *ppv;
|
|
||||||
unsigned *pte;
|
|
||||||
int s;
|
|
||||||
|
|
||||||
if (!pmap_is_managed(pa))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
ppv = pa_to_pvh(pa);
|
|
||||||
|
|
||||||
s = splvm();
|
|
||||||
/*
|
|
||||||
* Not found, check current mappings returning immediately if found.
|
|
||||||
*/
|
|
||||||
for (pv = TAILQ_FIRST(&ppv->pv_list);
|
|
||||||
pv;
|
|
||||||
pv = TAILQ_NEXT(pv, pv_list)) {
|
|
||||||
|
|
||||||
/*
|
|
||||||
* if the bit being tested is the modified bit, then
|
|
||||||
* mark clean_map and ptes as never
|
|
||||||
* modified.
|
|
||||||
*/
|
|
||||||
if (!pmap_track_modified(pv->pv_va))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
pte = pmap_pte_quick(pv->pv_pmap, pv->pv_va);
|
|
||||||
if ((int) *pte & PG_A) {
|
|
||||||
splx(s);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
splx(s);
|
|
||||||
return (FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pmap_ts_referenced:
|
* pmap_ts_referenced:
|
||||||
*
|
*
|
||||||
@ -3031,8 +2986,10 @@ pmap_mincore(pmap, addr)
|
|||||||
* Referenced by someone
|
* Referenced by someone
|
||||||
*/
|
*/
|
||||||
else if ((PHYS_TO_VM_PAGE(pa)->flags & PG_REFERENCED) ||
|
else if ((PHYS_TO_VM_PAGE(pa)->flags & PG_REFERENCED) ||
|
||||||
pmap_is_referenced(pa))
|
pmap_ts_referenced(pa)) {
|
||||||
val |= MINCORE_REFERENCED_OTHER;
|
val |= MINCORE_REFERENCED_OTHER;
|
||||||
|
PHYS_TO_VM_PAGE(pa)->flags |= PG_REFERENCED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
* any improvements or extensions that they make and grant Carnegie the
|
* any improvements or extensions that they make and grant Carnegie the
|
||||||
* rights to redistribute these changes.
|
* rights to redistribute these changes.
|
||||||
*
|
*
|
||||||
* $Id: pmap.h,v 1.15 1996/09/08 20:44:31 dyson Exp $
|
* $Id: pmap.h,v 1.16 1996/10/15 03:16:43 dyson Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -100,7 +100,6 @@ vm_offset_t pmap_extract __P((pmap_t, vm_offset_t));
|
|||||||
void pmap_growkernel __P((vm_offset_t));
|
void pmap_growkernel __P((vm_offset_t));
|
||||||
void pmap_init __P((vm_offset_t, vm_offset_t));
|
void pmap_init __P((vm_offset_t, vm_offset_t));
|
||||||
boolean_t pmap_is_modified __P((vm_offset_t pa));
|
boolean_t pmap_is_modified __P((vm_offset_t pa));
|
||||||
boolean_t pmap_is_referenced __P((vm_offset_t pa));
|
|
||||||
boolean_t pmap_ts_referenced __P((vm_offset_t pa));
|
boolean_t pmap_ts_referenced __P((vm_offset_t pa));
|
||||||
void pmap_kenter __P((vm_offset_t, vm_offset_t));
|
void pmap_kenter __P((vm_offset_t, vm_offset_t));
|
||||||
void pmap_kremove __P((vm_offset_t));
|
void pmap_kremove __P((vm_offset_t));
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
* from: Utah $Hdr: swap_pager.c 1.4 91/04/30$
|
* from: Utah $Hdr: swap_pager.c 1.4 91/04/30$
|
||||||
*
|
*
|
||||||
* @(#)swap_pager.c 8.9 (Berkeley) 3/21/94
|
* @(#)swap_pager.c 8.9 (Berkeley) 3/21/94
|
||||||
* $Id: swap_pager.c,v 1.71 1996/09/08 20:44:33 dyson Exp $
|
* $Id: swap_pager.c,v 1.72 1996/10/12 20:09:44 bde Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1077,7 +1077,9 @@ swap_pager_getpages(object, m, count, reqpage)
|
|||||||
pagedaemon_wakeup();
|
pagedaemon_wakeup();
|
||||||
swap_pager_needflags &= ~(SWAP_FREE_NEEDED|SWAP_FREE_NEEDED_BY_PAGEOUT);
|
swap_pager_needflags &= ~(SWAP_FREE_NEEDED|SWAP_FREE_NEEDED_BY_PAGEOUT);
|
||||||
if (rv == VM_PAGER_OK) {
|
if (rv == VM_PAGER_OK) {
|
||||||
|
#if notneeded
|
||||||
pmap_clear_modify(VM_PAGE_TO_PHYS(m[reqpage]));
|
pmap_clear_modify(VM_PAGE_TO_PHYS(m[reqpage]));
|
||||||
|
#endif
|
||||||
m[reqpage]->valid = VM_PAGE_BITS_ALL;
|
m[reqpage]->valid = VM_PAGE_BITS_ALL;
|
||||||
m[reqpage]->dirty = 0;
|
m[reqpage]->dirty = 0;
|
||||||
}
|
}
|
||||||
@ -1091,7 +1093,9 @@ swap_pager_getpages(object, m, count, reqpage)
|
|||||||
*/
|
*/
|
||||||
if (rv == VM_PAGER_OK) {
|
if (rv == VM_PAGER_OK) {
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
|
#if notneeded
|
||||||
pmap_clear_modify(VM_PAGE_TO_PHYS(m[i]));
|
pmap_clear_modify(VM_PAGE_TO_PHYS(m[i]));
|
||||||
|
#endif
|
||||||
m[i]->dirty = 0;
|
m[i]->dirty = 0;
|
||||||
m[i]->flags &= ~PG_ZERO;
|
m[i]->flags &= ~PG_ZERO;
|
||||||
if (i != reqpage) {
|
if (i != reqpage) {
|
||||||
@ -1476,7 +1480,7 @@ retryfree:
|
|||||||
*/
|
*/
|
||||||
if ((m[i]->queue != PQ_ACTIVE) &&
|
if ((m[i]->queue != PQ_ACTIVE) &&
|
||||||
((m[i]->flags & (PG_WANTED|PG_REFERENCED)) ||
|
((m[i]->flags & (PG_WANTED|PG_REFERENCED)) ||
|
||||||
pmap_is_referenced(VM_PAGE_TO_PHYS(m[i])))) {
|
pmap_ts_referenced(VM_PAGE_TO_PHYS(m[i])))) {
|
||||||
vm_page_activate(m[i]);
|
vm_page_activate(m[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1583,7 +1587,7 @@ swap_pager_finish(spc)
|
|||||||
pmap_clear_modify(VM_PAGE_TO_PHYS(spc->spc_m[i]));
|
pmap_clear_modify(VM_PAGE_TO_PHYS(spc->spc_m[i]));
|
||||||
spc->spc_m[i]->dirty = 0;
|
spc->spc_m[i]->dirty = 0;
|
||||||
if ((spc->spc_m[i]->queue != PQ_ACTIVE) &&
|
if ((spc->spc_m[i]->queue != PQ_ACTIVE) &&
|
||||||
((spc->spc_m[i]->flags & PG_WANTED) || pmap_is_referenced(VM_PAGE_TO_PHYS(spc->spc_m[i]))))
|
((spc->spc_m[i]->flags & PG_WANTED) || pmap_ts_referenced(VM_PAGE_TO_PHYS(spc->spc_m[i]))))
|
||||||
vm_page_activate(spc->spc_m[i]);
|
vm_page_activate(spc->spc_m[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
* from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$
|
* from: Utah $Hdr: vm_mmap.c 1.6 91/10/21$
|
||||||
*
|
*
|
||||||
* @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94
|
* @(#)vm_mmap.c 8.4 (Berkeley) 1/12/94
|
||||||
* $Id: vm_mmap.c,v 1.56 1996/12/28 22:40:44 dyson Exp $
|
* $Id: vm_mmap.c,v 1.57 1996/12/30 05:31:15 dyson Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -697,8 +697,10 @@ mincore(p, uap, retval)
|
|||||||
pmap_is_modified(VM_PAGE_TO_PHYS(m)))
|
pmap_is_modified(VM_PAGE_TO_PHYS(m)))
|
||||||
mincoreinfo |= MINCORE_MODIFIED_OTHER;
|
mincoreinfo |= MINCORE_MODIFIED_OTHER;
|
||||||
if ((m->flags & PG_REFERENCED) ||
|
if ((m->flags & PG_REFERENCED) ||
|
||||||
pmap_is_referenced(VM_PAGE_TO_PHYS(m)))
|
pmap_ts_referenced(VM_PAGE_TO_PHYS(m))) {
|
||||||
|
m->flags |= PG_REFERENCED;
|
||||||
mincoreinfo |= MINCORE_REFERENCED_OTHER;
|
mincoreinfo |= MINCORE_REFERENCED_OTHER;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user