#
fcb04758 |
| 23-Jan-2020 |
Jeff Roberson <jeff@FreeBSD.org> |
(fault 3/9) Move map relookup into a dedicated function.
Add a new VM return code KERN_RESTART which means, deallocate and restart in fault.
Reviewed by: kib, markj Differential Revision: https://r
(fault 3/9) Move map relookup into a dedicated function.
Add a new VM return code KERN_RESTART which means, deallocate and restart in fault.
Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23303
show more ...
|
#
c308a3a6 |
| 23-Jan-2020 |
Jeff Roberson <jeff@FreeBSD.org> |
(fault 2/9) Move map lookup into a dedicated function.
Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23302
|
#
2c2f4413 |
| 23-Jan-2020 |
Jeff Roberson <jeff@FreeBSD.org> |
(fault 1/9) Move a handful of stack variables into the faultstate.
This additionally fixes a potential bug/pessimization where we could fail to reload the original fault_type on restart.
Reviewed b
(fault 1/9) Move a handful of stack variables into the faultstate.
This additionally fixes a potential bug/pessimization where we could fail to reload the original fault_type on restart.
Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23301
show more ...
|
#
5949b1ca |
| 21-Jan-2020 |
Jeff Roberson <jeff@FreeBSD.org> |
Move readahead and dropbehind fault functionality into a helper routine for clarity.
Reviewed by: dougm, kib, markj Differential Revision: https://reviews.freebsd.org/D23282
|
#
1e40fe41 |
| 20-Jan-2020 |
Jeff Roberson <jeff@FreeBSD.org> |
Reduce object locking in vm_fault. Once we have an exclusively busied page we no longer need an object lock. This reduces the longest hold times and eliminates some trylock code blocks.
Reviewed b
Reduce object locking in vm_fault. Once we have an exclusively busied page we no longer need an object lock. This reduces the longest hold times and eliminates some trylock code blocks.
Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23034
show more ...
|
#
53d2936c |
| 20-Jan-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r356848 through r356919.
|
#
d6e13f3b |
| 20-Jan-2020 |
Jeff Roberson <jeff@FreeBSD.org> |
Don't hold the object lock while calling getpages.
The vnode pager does not want the object lock held. Moving this out allows further object lock scope reduction in callers. While here add some mi
Don't hold the object lock while calling getpages.
The vnode pager does not want the object lock held. Moving this out allows further object lock scope reduction in callers. While here add some missing paging in progress calls and an assert. The object handle is now protected explicitly with pip.
Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23033
show more ...
|
#
58447749 |
| 17-Jan-2020 |
Jeff Roberson <jeff@FreeBSD.org> |
Fix a long standing bug that was made worse in r355765. When we are cowing a page that was previously mapped read-only it exists in pmap until pmap_enter() returns. However, we held no reference to
Fix a long standing bug that was made worse in r355765. When we are cowing a page that was previously mapped read-only it exists in pmap until pmap_enter() returns. However, we held no reference to the original page after the copy was complete. This allowed vm_object_scan_all_shadowed() to collapse an object that still had pages mapped. To resolve this, add another page pointer to the faultstate so we can keep the page xbusy until we're done with pmap_enter(). Handle busy pages in scan_all_shadowed. This is already done in vm_object_collapse_scan().
Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23155
show more ...
|
#
9f5632e6 |
| 28-Dec-2019 |
Mark Johnston <markj@FreeBSD.org> |
Remove page locking for queue operations.
With the previous reviews, the page lock is no longer required in order to perform queue operations on a page. It is also no longer needed in the page queu
Remove page locking for queue operations.
With the previous reviews, the page lock is no longer required in order to perform queue operations on a page. It is also no longer needed in the page queue scans. This change effectively eliminates remaining uses of the page lock and also the false sharing caused by multiple pages sharing a page lock.
Reviewed by: jeff Tested by: pho Sponsored by: Netflix, Intel Differential Revision: https://reviews.freebsd.org/D22885
show more ...
|
#
7e1b379e |
| 24-Dec-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
Don't unnecessarily relock the vm object after sleeps. This results in a surprising amount of object contention on loop restarts in fault.
Reviewed by: kib, markj Differential Revision: https://rev
Don't unnecessarily relock the vm object after sleeps. This results in a surprising amount of object contention on loop restarts in fault.
Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22821
show more ...
|
#
419f0b1f |
| 22-Dec-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
Fix a bug introduced in r356002. Prior versions of this patchset had vm_page_remove() rather than !vm_page_wired() as the condition for free. When this changed back to wired the busy lock was leaked
Fix a bug introduced in r356002. Prior versions of this patchset had vm_page_remove() rather than !vm_page_wired() as the condition for free. When this changed back to wired the busy lock was leaked.
Reported by: pho Reviewed by: markj
show more ...
|
#
3cf3b4e6 |
| 22-Dec-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
Make page busy state deterministic on free. Pages must be xbusy when removed from objects including calls to free. Pages must not be xbusy when freed and not on an object. Strengthen assertions to
Make page busy state deterministic on free. Pages must be xbusy when removed from objects including calls to free. Pages must not be xbusy when freed and not on an object. Strengthen assertions to match these expectations. In practice very little code had to change busy handling to meet these rules but we can now make stronger guarantees to busy holders and avoid conditionally dropping busy in free.
Refine vm_page_remove() and vm_page_replace() semantics now that we have stronger guarantees about busy state. This removes redundant and potentially problematic code that has proliferated.
Discussed with: markj Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22822
show more ...
|
#
bef91632 |
| 22-Dec-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
Move vm_fault busy logic into its own function for clarity and re-use by later changes.
Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D22820
|
#
4bf95d00 |
| 15-Dec-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
Previously we did not support invalid pages in default objects. This means that if fault fails to progress and needs to restart the loop it must free the page it is working on and allocate again on
Previously we did not support invalid pages in default objects. This means that if fault fails to progress and needs to restart the loop it must free the page it is working on and allocate again on restart. Resolve the few places that need to be modified to support this condition and simply deactivate the page. Presently, we only permit this when fault restarts for busy contention. This has an added benefit of removing some object trylocking in this case.
While here consolidate some page cleanup logic into fault_page_free() and fault_page_release() to reduce redundant code and automate some teardown.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D22653
show more ...
|
#
a8081778 |
| 15-Dec-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
Add a deferred free mechanism for freeing swap space that does not require an exclusive object lock.
Previously swap space was freed on a best effort basis when a page that had valid swap was dirtie
Add a deferred free mechanism for freeing swap space that does not require an exclusive object lock.
Previously swap space was freed on a best effort basis when a page that had valid swap was dirtied, thus invalidating the swap copy. This may be done inconsistently and requires the object lock which is not always convenient.
Instead, track when swap space is present. The first dirty is responsible for deleting space or setting PGA_SWAP_FREE which will trigger background scans to free the swap space.
Simplify the locking in vm_fault_dirty() now that we can reliably identify the first dirty.
Discussed with: alc, kib, markj Differential Revision: https://reviews.freebsd.org/D22654
show more ...
|
#
67388836 |
| 01-Dec-2019 |
Konstantin Belousov <kib@FreeBSD.org> |
Store the bottom of the shadow chain in OBJ_ANON object->handle member.
The handle value is stable for all shadow objects in the inheritance chain. This allows to avoid descending the shadow chain
Store the bottom of the shadow chain in OBJ_ANON object->handle member.
The handle value is stable for all shadow objects in the inheritance chain. This allows to avoid descending the shadow chain to get to the bottom of it in vm_map_entry_set_vnode_text(), and eliminate corresponding object relocking which appeared to be contending.
Change vm_object_allocate_anon() and vm_object_shadow() to handle more of the cred/charge initialization for the new shadow object, in addition to set up the handle.
Reported by: jeff Reviewed by: alc (previous version), jeff (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation Differrential revision: https://reviews.freebsd.org/D22541
show more ...
|
#
63967687 |
| 20-Nov-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
Simplify anonymous memory handling with an OBJ_ANON flag. This eliminates reudundant complicated checks and additional locking required only for anonymous memory. Introduce vm_object_allocate_anon(
Simplify anonymous memory handling with an OBJ_ANON flag. This eliminates reudundant complicated checks and additional locking required only for anonymous memory. Introduce vm_object_allocate_anon() to create these objects. DEFAULT and SWAP objects now have the correct settings for non-anonymous consumers and so individual consumers need not modify the default flags to create super-pages and avoid ONEMAPPING/NOSPLIT.
Reviewed by: alc, dougm, kib, markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D22119
show more ...
|
#
be801aaa |
| 06-Nov-2019 |
Mark Johnston <markj@FreeBSD.org> |
Fix a race in release_page().
Since r354156 we may call release_page() without the page's object lock held, specifically following the page copy during a CoW fault. release_page() must therefore unb
Fix a race in release_page().
Since r354156 we may call release_page() without the page's object lock held, specifically following the page copy during a CoW fault. release_page() must therefore unbusy the page only after scheduling the requeue, to avoid racing with a free of the page. Previously, the object lock prevented this race from occurring.
Add some assertions that were helpful in tracking this down.
Reported by: pho, syzkaller Tested by: pho Reviewed by: alc, jeff, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22234
show more ...
|
Revision tags: release/12.1.0 |
|
#
67d0e293 |
| 29-Oct-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove the TMPFS_DIRTY flag and use the same system.
This enables further fault locking improvements by allowing more faults to proceed with a
Replace OBJ_MIGHTBEDIRTY with a system using atomics. Remove the TMPFS_DIRTY flag and use the same system.
This enables further fault locking improvements by allowing more faults to proceed with a shared lock.
Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22116
show more ...
|
#
4b3e0665 |
| 29-Oct-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
Drop the object lock earlier in fault and don't relock it after pmap_enter().
Recent changes in object and page locking have enabled more lock pushdown.
Reviewed by: kib Tested by: pho Differential
Drop the object lock earlier in fault and don't relock it after pmap_enter().
Recent changes in object and page locking have enabled more lock pushdown.
Reviewed by: kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22036
show more ...
|
#
be2c5610 |
| 23-Oct-2019 |
Mark Johnston <markj@FreeBSD.org> |
Modify release_page() to handle a missing fault page.
r353890 introduced a case where we may call release_page() with fs.m == NULL, since the fault handler may now lock the vnode prior to allocating
Modify release_page() to handle a missing fault page.
r353890 introduced a case where we may call release_page() with fs.m == NULL, since the fault handler may now lock the vnode prior to allocating a page for a page-in.
Reported by: jhb Reviewed by: kib MFC with: r353890 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22120
show more ...
|
#
16b0c092 |
| 23-Oct-2019 |
Konstantin Belousov <kib@FreeBSD.org> |
Assert that vm_fault_lock_vnode() returns locked saved vnode.
Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D22113
|
#
208b81bb |
| 22-Oct-2019 |
Konstantin Belousov <kib@FreeBSD.org> |
Add VV_VMSIZEVNLOCK flag.
The flag specifies that vm_fault() handler should check the vnode' vm_object size under the vnode lock. It is converted into the object' OBJ_SIZEVNLOCK flag in vnode_pager
Add VV_VMSIZEVNLOCK flag.
The flag specifies that vm_fault() handler should check the vnode' vm_object size under the vnode lock. It is converted into the object' OBJ_SIZEVNLOCK flag in vnode_pager_alloc().
Tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D21883
show more ...
|
#
0ddd3082 |
| 22-Oct-2019 |
Konstantin Belousov <kib@FreeBSD.org> |
vm_fault(): extract code to lock the vnode into a helper vn_fault_lock_vnode().
Tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https
vm_fault(): extract code to lock the vnode into a helper vn_fault_lock_vnode().
Tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D21883
show more ...
|
#
fff5403f |
| 15-Oct-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
(5/6) Move the VPO_NOSYNC to PGA_NOSYNC to eliminate the dependency on the object lock in vm_page_set_validclean().
Reviewed by: kib, markj Tested by: pho Sponsored by: Netflix, Intel Diff
(5/6) Move the VPO_NOSYNC to PGA_NOSYNC to eliminate the dependency on the object lock in vm_page_set_validclean().
Reviewed by: kib, markj Tested by: pho Sponsored by: Netflix, Intel Differential Revision: https://reviews.freebsd.org/D21595
show more ...
|