Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_pageout.c
Show First 20 Lines • Show All 251 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Add a small number of queued pages to a batch queue for later processing | * Add a small number of queued pages to a batch queue for later processing | ||||
* without the corresponding queue lock held. The caller must have enqueued a | * without the corresponding queue lock held. The caller must have enqueued a | ||||
* marker page at the desired start point for the scan. Pages will be | * marker page at the desired start point for the scan. Pages will be | ||||
* physically dequeued if the caller so requests. Otherwise, the returned | * physically dequeued if the caller so requests. Otherwise, the returned | ||||
* batch may contain marker pages, and it is up to the caller to handle them. | * batch may contain marker pages, and it is up to the caller to handle them. | ||||
* | * | ||||
* When processing the batch queue, vm_page_queue() must be used to | * When processing the batch queue, vm_pageout_defer() must be used to | ||||
* determine whether the page has been logically dequeued by another thread. | * determine whether the page has been logically dequeued since the batch was | ||||
* Once this check is performed, the page lock guarantees that the page will | * collected. | ||||
* not be disassociated from the queue. | |||||
*/ | */ | ||||
static __always_inline void | static __always_inline void | ||||
vm_pageout_collect_batch(struct scan_state *ss, const bool dequeue) | vm_pageout_collect_batch(struct scan_state *ss, const bool dequeue) | ||||
{ | { | ||||
struct vm_pagequeue *pq; | struct vm_pagequeue *pq; | ||||
vm_page_t m, marker, n; | vm_page_t m, marker, n; | ||||
marker = ss->marker; | marker = ss->marker; | ||||
▲ Show 20 Lines • Show All 1,972 Lines • Show Last 20 Lines |