sys/vm/vm_page.c
/*
 * Heuristical page lookup that does not require any locks.  Returns
 * a soft-busied page on success, NULL on failure.
 *
 * Caller must lookup the page the slow way if NULL is returned.
 */
Heuristical page lookup that does not require any locks.  Returns
a soft-busied page on success, NULL on failure.

Caller must lookup the page the slow way if NULL is returned.
Heuristical page lookup that does not require any locks . Returns a soft - busied page on success NULL on failure . Caller must lookup the page the slow way if NULL is returned .
vm_page_t
vm_page_hash_get(vm_object_t object, vm_pindex_t pindex)
{
	struct vm_page_hash_elm *mp;
	vm_page_t m;
	int i;
	if (vm_page_hash == NULL)
		return NULL;
	mp = vm_page_hash_hash(object, pindex);
	for (i = 0; i < VM_PAGE_HASH_SET; ++i) {
		m = mp[i].m;
		cpu_ccfence();
		if (m == NULL)
			continue;
		if (m->object != object || m->pindex != pindex)
			continue;
		if (vm_page_sbusy_try(m))
			continue;
		if (m->object == object && m->pindex == pindex) {
			mp[i].ticks = ticks;
			return m;
		}
		vm_page_sbusy_drop(m);
	}
	return NULL;
}
vm_page_t vm_page_hash_get ( vm_object_t object , vm_pindex_t pindex ) { struct vm_page_hash_elm * mp ; vm_page_t m ; int i ; if ( vm_page_hash == NULL ) return NULL ; mp = vm_page_hash_hash ( object , pindex ) ; for ( i = 0 ; i < VM_PAGE_HASH_SET ; ++ i ) { m = mp [ i ] . m ; cpu_ccfence ( ) ; if ( m == NULL ) continue ; if ( m -> object != object || m -> pindex != pindex ) continue ; if ( vm_page_sbusy_try ( m ) ) continue ; if ( m -> object == object && m -> pindex == pindex ) { mp [ i ] . ticks = ticks ; return m ; } vm_page_sbusy_drop ( m ) ; } return NULL ; }
Heuristical page lookup that does not require any locks.
Heuristical page lookup that does not require any locks .