This change introduces 'vm_fault_wire', a memory wiring routine with
a fast path for objects implementing the own 'pgo_populate' pager
methods. The fast path (vm_fault_wire_quick) uses 'vm_pager_populate'
to preallocate pages for the entire map entry instead of using 'vm_page_grab'
for each 0-order pager. Unlike the slow path, it is superpage-aware and
will avoid extraneous page lookup when processing pages whose psind
is larger than zero. This change is mostly aimed at speeding up memory
wiring in the bhyve hypervisor.
Details
See the test plan in D60752.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 78470 Build 75353: arc lint + arc unit
Event Timeline
| sys/vm/vm_fault.c | ||
|---|---|---|
| 2538 | Perhaps assert that the OBJ_POPULATE flag is set. | |
| 2541 | Why do you need to take a reference on the object? If you pip_add-ed it, the object cannot be terminated. | |
| 2589 | Why not do the cleanup from 'we broke out of the loop...' there? If you set rv = KERN_SUCCESS before the loop, that if() become unneeded I think. | |
| 2632 | Why do you filter out MAP_ENTRY_COW? The indent on this and next line should be just +4 spaces. | |
| sys/vm/vm_fault.c | ||
|---|---|---|
| 2538 | And existing code calling the object populate method is careful to ensure that the map and the vnode are unlocked around it. E.g. it could end up in vm_page_grab sleeping and waiting for pagedaemon, with the vnode locked. | |
| 2569 | I think that the term 'remove' is confusing. It is more like 'unbusy and clip the unneeded tail of the run' then removal of pages. | |
| 2586 | Suppose that several calls to pmap_enter() succeeded, but then it failed, due to PMAP_ENTER_NOSLEEP. | |