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

Function vm_page_mvqueue

freebsd/vm/vm_page.c:4060–4089  ·  view source on GitHub ↗

* Ensure that the page ends up in the specified page queue. If the page is * active or being moved to the active queue, ensure that its act_count is * at least ACT_INIT but do not otherwise mess with it. */

Source from the content-addressed store, hash-verified

4058 * at least ACT_INIT but do not otherwise mess with it.
4059 */
4060static __always_inline void
4061vm_page_mvqueue(vm_page_t m, const uint8_t nqueue, const uint16_t nflag)
4062{
4063 vm_page_astate_t old, new;
4064
4065 KASSERT(m->ref_count > 0,
4066 ("%s: page %p does not carry any references", __func__, m));
4067 KASSERT(nflag == PGA_REQUEUE || nflag == PGA_REQUEUE_HEAD,
4068 ("%s: invalid flags %x", __func__, nflag));
4069
4070 if ((m->oflags & VPO_UNMANAGED) != 0 || vm_page_wired(m))
4071 return;
4072
4073 old = vm_page_astate_load(m);
4074 do {
4075 if ((old.flags & PGA_DEQUEUE) != 0)
4076 break;
4077 new = old;
4078 new.flags &= ~PGA_QUEUE_OP_MASK;
4079 if (nqueue == PQ_ACTIVE)
4080 new.act_count = max(old.act_count, ACT_INIT);
4081 if (old.queue == nqueue) {
4082 if (nqueue != PQ_ACTIVE)
4083 new.flags |= nflag;
4084 } else {
4085 new.flags |= nflag;
4086 new.queue = nqueue;
4087 }
4088 } while (!vm_page_pqstate_commit(m, &old, new));
4089}
4090
4091/*
4092 * Put the specified page on the active list (if appropriate).

Callers 4

vm_page_activateFunction · 0.85
vm_page_deactivateFunction · 0.85
vm_page_launderFunction · 0.85

Calls 4

vm_page_wiredFunction · 0.85
vm_page_astate_loadFunction · 0.85
maxFunction · 0.85
vm_page_pqstate_commitFunction · 0.85

Tested by

no test coverage detected