Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_page.c
Show First 20 Lines • Show All 4,135 Lines • ▼ Show 20 Lines | vm_page_mvqueue(vm_page_t m, const uint8_t nqueue, const uint16_t nflag) | ||||
do { | do { | ||||
if ((old.flags & PGA_DEQUEUE) != 0) | if ((old.flags & PGA_DEQUEUE) != 0) | ||||
break; | break; | ||||
new = old; | new = old; | ||||
new.flags &= ~PGA_QUEUE_OP_MASK; | new.flags &= ~PGA_QUEUE_OP_MASK; | ||||
if (nqueue == PQ_ACTIVE) | if (nqueue == PQ_ACTIVE) | ||||
new.act_count = max(old.act_count, ACT_INIT); | new.act_count = max(old.act_count, ACT_INIT); | ||||
if (old.queue == nqueue) { | if (old.queue == nqueue) { | ||||
if (nqueue != PQ_ACTIVE) | /* | ||||
* There is no need to requeue pages already in the | |||||
* active queue. | |||||
*/ | |||||
if (nqueue != PQ_ACTIVE || | |||||
(old.flags & PGA_ENQUEUED) == 0) | |||||
new.flags |= nflag; | new.flags |= nflag; | ||||
} else { | } else { | ||||
new.flags |= nflag; | new.flags |= nflag; | ||||
new.queue = nqueue; | new.queue = nqueue; | ||||
} | } | ||||
} while (!vm_page_pqstate_commit(m, &old, new)); | } while (!vm_page_pqstate_commit(m, &old, new)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | do { | ||||
new = old; | new = old; | ||||
/* | /* | ||||
* If the page is already in the active queue and we are not | * If the page is already in the active queue and we are not | ||||
* trying to accelerate reclamation, simply mark it as | * trying to accelerate reclamation, simply mark it as | ||||
* referenced and avoid any queue operations. | * referenced and avoid any queue operations. | ||||
*/ | */ | ||||
new.flags &= ~PGA_QUEUE_OP_MASK; | new.flags &= ~PGA_QUEUE_OP_MASK; | ||||
if (nflag != PGA_REQUEUE_HEAD && old.queue == PQ_ACTIVE) | if (nflag != PGA_REQUEUE_HEAD && old.queue == PQ_ACTIVE && | ||||
(old.flags & PGA_ENQUEUED) != 0) | |||||
new.flags |= PGA_REFERENCED; | new.flags |= PGA_REFERENCED; | ||||
else { | else { | ||||
new.flags |= nflag; | new.flags |= nflag; | ||||
new.queue = nqueue; | new.queue = nqueue; | ||||
} | } | ||||
} while (!vm_page_pqstate_commit(m, &old, new)); | } while (!vm_page_pqstate_commit(m, &old, new)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,344 Lines • Show Last 20 Lines |