MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_page_pqstate_commit

Function vm_page_pqstate_commit

freebsd/vm/vm_page.c:3505–3525  ·  view source on GitHub ↗

* A generic queue state update function. This handles more cases than the * specialized functions above. */

Source from the content-addressed store, hash-verified

3503 * specialized functions above.
3504 */
3505bool
3506vm_page_pqstate_commit(vm_page_t m, vm_page_astate_t *old, vm_page_astate_t new)
3507{
3508
3509 if (old->_bits == new._bits)
3510 return (true);
3511
3512 if (old->queue != PQ_NONE && new.queue != old->queue) {
3513 if (!vm_page_pqstate_commit_dequeue(m, old, new))
3514 return (false);
3515 if (new.queue != PQ_NONE)
3516 vm_page_pqbatch_submit(m, new.queue);
3517 } else {
3518 if (!vm_page_pqstate_fcmpset(m, old, new))
3519 return (false);
3520 if (new.queue != PQ_NONE &&
3521 ((new.flags & ~old->flags) & PGA_QUEUE_OP_MASK) != 0)
3522 vm_page_pqbatch_submit(m, new.queue);
3523 }
3524 return (true);
3525}
3526
3527/*
3528 * Apply deferred queue state updates to a page.

Callers 5

vm_page_mvqueueFunction · 0.85
vm_page_release_toqFunction · 0.85
vm_pageout_launderFunction · 0.85
vm_pageout_scan_activeFunction · 0.85
vm_pageout_scan_inactiveFunction · 0.85

Calls 3

vm_page_pqbatch_submitFunction · 0.85
vm_page_pqstate_fcmpsetFunction · 0.85

Tested by

no test coverage detected