In vm_object_madvise() setting PG_REFERENCED on a page before sleeping on
that page only makes sense if the advice is MADV_WILLNEED. In that case, the intention is to activate the page, so discouraging the page daemon from reclaiming the page makes sense. In contrast, in the other cases, MADV_DONTNEED and MADV_FREE, it makes no sense whatsoever to discourage the page daemon from reclaiming the page by setting PG_REFERENCED. Wrap a nearby line. Discussed with: kib MFC after: 3 weeks
This commit is contained in:
parent
1a58736816
commit
b11b56b55b
@ -1205,12 +1205,19 @@ shadowlookup:
|
|||||||
goto unlock_tobject;
|
goto unlock_tobject;
|
||||||
}
|
}
|
||||||
if ((m->oflags & VPO_BUSY) || m->busy) {
|
if ((m->oflags & VPO_BUSY) || m->busy) {
|
||||||
vm_page_flag_set(m, PG_REFERENCED);
|
if (advise == MADV_WILLNEED)
|
||||||
|
/*
|
||||||
|
* Reference the page before unlocking and
|
||||||
|
* sleeping so that the page daemon is less
|
||||||
|
* likely to reclaim it.
|
||||||
|
*/
|
||||||
|
vm_page_flag_set(m, PG_REFERENCED);
|
||||||
vm_page_unlock_queues();
|
vm_page_unlock_queues();
|
||||||
if (object != tobject)
|
if (object != tobject)
|
||||||
VM_OBJECT_UNLOCK(object);
|
VM_OBJECT_UNLOCK(object);
|
||||||
m->oflags |= VPO_WANTED;
|
m->oflags |= VPO_WANTED;
|
||||||
msleep(m, VM_OBJECT_MTX(tobject), PDROP | PVM, "madvpo", 0);
|
msleep(m, VM_OBJECT_MTX(tobject), PDROP | PVM, "madvpo",
|
||||||
|
0);
|
||||||
VM_OBJECT_LOCK(object);
|
VM_OBJECT_LOCK(object);
|
||||||
goto relookup;
|
goto relookup;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user