Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_page.c
Show First 20 Lines • Show All 1,352 Lines • ▼ Show 20 Lines | vm_page_sleep_if_busy(vm_page_t m, const char *msg) | ||||
/* | /* | ||||
* The page-specific object must be cached because page | * The page-specific object must be cached because page | ||||
* identity can change during the sleep, causing the | * identity can change during the sleep, causing the | ||||
* re-lock of a different object. | * re-lock of a different object. | ||||
* It is assumed that a reference to the object is already | * It is assumed that a reference to the object is already | ||||
* held by the callers. | * held by the callers. | ||||
*/ | */ | ||||
obj = m->object; | obj = m->object; | ||||
if (vm_page_busied(m) || (obj != NULL && obj->busy)) { | if (vm_page_busied(m) || (obj != NULL && vm_object_busied(obj))) { | ||||
vm_page_busy_sleep(m, msg, false); | vm_page_busy_sleep(m, msg, false); | ||||
VM_OBJECT_WLOCK(obj); | VM_OBJECT_WLOCK(obj); | ||||
return (TRUE); | return (TRUE); | ||||
} | } | ||||
return (FALSE); | return (FALSE); | ||||
} | } | ||||
/* | /* | ||||
Show All 16 Lines | vm_page_sleep_if_xbusy(vm_page_t m, const char *msg) | ||||
/* | /* | ||||
* The page-specific object must be cached because page | * The page-specific object must be cached because page | ||||
* identity can change during the sleep, causing the | * identity can change during the sleep, causing the | ||||
* re-lock of a different object. | * re-lock of a different object. | ||||
* It is assumed that a reference to the object is already | * It is assumed that a reference to the object is already | ||||
* held by the callers. | * held by the callers. | ||||
*/ | */ | ||||
obj = m->object; | obj = m->object; | ||||
if (vm_page_xbusied(m) || (obj != NULL && obj->busy)) { | if (vm_page_xbusied(m) || (obj != NULL && vm_object_busied(obj))) { | ||||
vm_page_busy_sleep(m, msg, true); | vm_page_busy_sleep(m, msg, true); | ||||
VM_OBJECT_WLOCK(obj); | VM_OBJECT_WLOCK(obj); | ||||
return (TRUE); | return (TRUE); | ||||
} | } | ||||
return (FALSE); | return (FALSE); | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 3,761 Lines • Show Last 20 Lines |