Clear queue operation flags when migrating a page to another queue.
The page daemon loops may move pages back to the active queue if references are detected. In this case we must take care to clear existing queue operation flags. In particular, PGA_REQUEUE_HEAD may be set, and that flag is only valid if the page belongs to the inactive queue. Also fix a bug in the active queue scan where we were updating "old" instead of "new". This would only have been hit in rare cases where the page moved out of the active queue after the beginning of the scan. Reported by: Bob Prohaska, Idwer Vollering Tested by: Idwer Vollering Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D23001
This commit is contained in:
parent
8f5c6c31ae
commit
f7607c300b
@ -834,6 +834,7 @@ scan:
|
||||
if (new.act_count > ACT_MAX)
|
||||
new.act_count = ACT_MAX;
|
||||
|
||||
new.flags &= ~PGA_QUEUE_OP_MASK;
|
||||
new.flags |= PGA_REQUEUE;
|
||||
new.queue = PQ_ACTIVE;
|
||||
if (!vm_page_pqstate_commit(m, &old, new))
|
||||
@ -1313,8 +1314,9 @@ act_scan:
|
||||
*/
|
||||
ps_delta = 0;
|
||||
if (old.queue != PQ_ACTIVE) {
|
||||
old.queue = PQ_ACTIVE;
|
||||
old.flags |= PGA_REQUEUE;
|
||||
new.flags &= ~PGA_QUEUE_OP_MASK;
|
||||
new.flags |= PGA_REQUEUE;
|
||||
new.queue = PQ_ACTIVE;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@ -1350,6 +1352,7 @@ act_scan:
|
||||
ps_delta = 1;
|
||||
}
|
||||
|
||||
new.flags &= ~PGA_QUEUE_OP_MASK;
|
||||
new.flags |= PGA_REQUEUE;
|
||||
new.queue = nqueue;
|
||||
}
|
||||
@ -1560,6 +1563,7 @@ vm_pageout_scan_inactive(struct vm_domain *vmd, int shortage,
|
||||
if (new.act_count > ACT_MAX)
|
||||
new.act_count = ACT_MAX;
|
||||
|
||||
new.flags &= ~PGA_QUEUE_OP_MASK;
|
||||
new.flags |= PGA_REQUEUE;
|
||||
new.queue = PQ_ACTIVE;
|
||||
if (!vm_page_pqstate_commit(m, &old, new))
|
||||
|
Loading…
x
Reference in New Issue
Block a user