Allow for fictitious physical pages in vm_page_scan_contig().

Some drm2 drivers will set PG_FICTITIOUS in physical pages in order to
satisfy the OBJT_MGTDEVICE object interface, so a scan may encounter
fictitous pages. For now, allow for this possibility; such pages will be
skipped later in the scan since they are wired.

Reported by:	avg
Reviewed by:	kib
MFC after:	1 week
This commit is contained in:
Mark Johnston 2017-11-21 13:17:40 +00:00
parent 90f528e8d7
commit 5070d56d41

View File

@ -2065,8 +2065,10 @@ vm_page_scan_contig(u_long npages, vm_page_t m_start, vm_page_t m_end,
run_len = 0;
m_mtx = NULL;
for (m = m_start; m < m_end && run_len < npages; m += m_inc) {
KASSERT((m->flags & (PG_FICTITIOUS | PG_MARKER)) == 0,
("page %p is PG_FICTITIOUS or PG_MARKER", m));
KASSERT((m->flags & PG_MARKER) == 0,
("page %p is PG_MARKER", m));
KASSERT((m->flags & PG_FICTITIOUS) == 0 || m->wire_count == 1,
("fictitious page %p has invalid wire count", m));
/*
* If the current page would be the start of a run, check its