FreeBSD/sys/arm64/arm64/pmap.c
/*
 * Returns true if the pmap's pv is one of the first
 * 16 pvs linked to from this page.  This count may
 * be changed upwards or downwards in the future; it
 * is only necessary that true be returned for a small
 * subset of pmaps for proper page aging.
 */
Returns true if the pmap's pv is one of the first
16 pvs linked to from this page.  This count may
be changed upwards or downwards in the future; it
is only necessary that true be returned for a small
subset of pmaps for proper page aging.
Returns true if the pmap ' s pv is one of the first 16 pvs linked to from this page . This count may be changed upwards or downwards in the future ; it is only necessary that true be returned for a small subset of pmaps for proper page aging .
boolean_t
pmap_page_exists_quick(pmap_t pmap, vm_page_t m)
{
	struct rwlock *lock;
	pv_entry_t pv;
	int loops = 0;
	boolean_t rv;
	KASSERT((m->oflags & VPO_UNMANAGED) == 0,
	    ("pmap_page_exists_quick: page %p is not managed", m));
	rv = FALSE;
	rw_rlock(&pvh_global_lock);
	lock = VM_PAGE_TO_PV_LIST_LOCK(m);
	rw_rlock(lock);
	TAILQ_FOREACH(pv, &m->md.pv_list, pv_next) {
		if (PV_PMAP(pv) == pmap) {
			rv = TRUE;
			break;
		}
		loops++;
		if (loops >= 16)
			break;
	}
	rw_runlock(lock);
	rw_runlock(&pvh_global_lock);
	return (rv);
}
boolean_t pmap_page_exists_quick ( pmap_t pmap , vm_page_t m ) { struct rwlock * lock ; pv_entry_t pv ; int loops = 0 ; boolean_t rv ; KASSERT ( ( m -> oflags & VPO_UNMANAGED ) == 0 , ( " " , m ) ) ; rv = FALSE ; rw_rlock ( & pvh_global_lock ) ; lock = VM_PAGE_TO_PV_LIST_LOCK ( m ) ; rw_rlock ( lock ) ; TAILQ_FOREACH ( pv , & m -> md . pv_list , pv_next ) { if ( PV_PMAP ( pv ) == pmap ) { rv = TRUE ; break ; } loops ++ ; if ( loops >= 16 ) break ; } rw_runlock ( lock ) ; rw_runlock ( & pvh_global_lock ) ; return ( rv ) ; }
Returns true if the pmap's pv is one of the first
 16 pvs linked to from this page.
Returns true if the pmap ' s pv is one of the first 16 pvs linked to from this page .