#
fccdefa1 |
| 28-May-2018 |
Alan Cox <alc@FreeBSD.org> |
Eliminate duplicate assertions. We assert at the start of vm_fault_hold() that the map entry is wired if the caller passes the flag VM_FAULT_WIRE. Eliminate the same assertion, but spelled different
Eliminate duplicate assertions. We assert at the start of vm_fault_hold() that the map entry is wired if the caller passes the flag VM_FAULT_WIRE. Eliminate the same assertion, but spelled differently, at the end of vm_fault_hold() and vm_fault_populate(). Repeat the assertion only if the map is unlocked and the map lookup must be repeated.
Reviewed by: kib MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D15582
show more ...
|
#
70183daa |
| 26-May-2018 |
Alan Cox <alc@FreeBSD.org> |
Use pmap_enter(..., psind=1) in vm_fault_populate() on amd64. While superpage mappings were already being created by automatic promotion in vm_fault_populate(), this change reduces the cost of creat
Use pmap_enter(..., psind=1) in vm_fault_populate() on amd64. While superpage mappings were already being created by automatic promotion in vm_fault_populate(), this change reduces the cost of creating those mappings. Essentially, one pmap_enter(..., psind=1) call takes the place of 512 pmap_enter(..., psind=0) calls, and that one pmap_enter(..., psind=1) call eliminates the allocation of a page table page.
Reviewed by: kib MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D15572
show more ...
|
#
d3f8534e |
| 24-May-2018 |
Alan Cox <alc@FreeBSD.org> |
Eliminate an unused parameter from vm_fault_populate().
Reviewed by: kib MFC after: 10 days
|
#
a7163bb9 |
| 29-Apr-2018 |
Konstantin Belousov <kib@FreeBSD.org> |
Eliminate some vm object relocks in vm fault.
For the vm_fault_prefault() call from vm_fault_soft_fast(), extend the scope of the object rlock to avoid re-taking it inside vm_fault_prefault(). It ca
Eliminate some vm object relocks in vm fault.
For the vm_fault_prefault() call from vm_fault_soft_fast(), extend the scope of the object rlock to avoid re-taking it inside vm_fault_prefault(). It causes pmap_enter_quick() sometimes called with shadow object lock as well as the page lock, but this looks innocent.
Noted and measured by: mjg Reviewed by: alc, markj (as part of the larger patch) Tested by: pho (as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D15122
show more ...
|
#
8ec533d3 |
| 26-Mar-2018 |
Konstantin Belousov <kib@FreeBSD.org> |
Allow to specify for vm_fault_quick_hold_pages() that nofault mode should be honored.
We must not sleep or acquire any MI VM locks if TDP_NOFAULTING is specified. On the other hand, there were some
Allow to specify for vm_fault_quick_hold_pages() that nofault mode should be honored.
We must not sleep or acquire any MI VM locks if TDP_NOFAULTING is specified. On the other hand, there were some callers in the tree which set TDP_NOFAULTING for larger scope than needed, I fixed the code which I wrote, but I suspect that linuxkpi and out of tree drm drivers might abuse this still.
So only enable the mode for vm_fault_quick_hold_pages() where vm_fault_hold() is not called when specifically asked by user. I decided to use vm_prot_t flag to not change KPI. Since number of flags in vm_prot_t is limited, I reused the same flag which was already consumed for vm_map_lookup().
Reported and tested by: pho (as part of the larger patch) Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14825
show more ...
|
#
c6a70eae |
| 18-Mar-2018 |
Mark Johnston <markj@FreeBSD.org> |
Avoid dequeuing the fault page during a soft fault.
Such pages are re-enqueued at the end of the fault handler, preserving LRU. Rather than performing two separate operations per fault, simply reque
Avoid dequeuing the fault page during a soft fault.
Such pages are re-enqueued at the end of the fault handler, preserving LRU. Rather than performing two separate operations per fault, simply requeue the page at the end of the fault (or bump its activation count if it resides in PQ_ACTIVE, avoiding the page queue lock entirely). This elides some page lock and page queue lock operations in common cases, e.g., CoW faults.
Note that we must still dequeue the source page for "optimized" CoW faults since the page may not remain enqueued while it is moved to another object.
Reviewed by: alc, kib Tested by: pho MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14625
show more ...
|
#
0eb50f9c |
| 18-Mar-2018 |
Mark Johnston <markj@FreeBSD.org> |
Have vm_page_{deactivate,launder}() requeue already-queued pages.
In many cases the page is not enqueued so the change will have no effect. However, the change is needed to support an optimization i
Have vm_page_{deactivate,launder}() requeue already-queued pages.
In many cases the page is not enqueued so the change will have no effect. However, the change is needed to support an optimization in the fault handler and in some cases (sendfile, the buffer cache) it was being emulated by the caller anyway.
Reviewed by: alc Tested by: pho MFC after: 2 weeks X-Differential Revision: https://reviews.freebsd.org/D14625
show more ...
|
#
2c0f13aa |
| 20-Feb-2018 |
Konstantin Belousov <kib@FreeBSD.org> |
vm_wait() rework.
Make vm_wait() take the vm_object argument which specifies the domain set to wait for the min condition pass. If there is no object associated with the wait, use curthread' policy
vm_wait() rework.
Make vm_wait() take the vm_object argument which specifies the domain set to wait for the min condition pass. If there is no object associated with the wait, use curthread' policy domainset. The mechanics of the wait in vm_wait() and vm_wait_domain() is supplied by the new helper vm_wait_doms(), which directly takes the bitmask of the domains to wait for passing min condition.
Eliminate pagedaemon_wait(). vm_domain_clear() handles the same operations.
Eliminate VM_WAIT and VM_WAITPFAULT macros, the direct functions calls are enough.
Eliminate several control state variables from vm_domain, unneeded after the vm_wait() conversion.
Scetched and reviewed by: jeff Tested by: pho Sponsored by: The FreeBSD Foundation, Mellanox Technologies Differential revision: https://reviews.freebsd.org/D14384
show more ...
|
#
d929ad7f |
| 14-Feb-2018 |
Konstantin Belousov <kib@FreeBSD.org> |
Ensure memory consistency on COW.
From the submitter description: The process is forked transitioning a map entry to COW Thread A writes to a page on the map entry, faults, updates the pmap to wri
Ensure memory consistency on COW.
From the submitter description: The process is forked transitioning a map entry to COW Thread A writes to a page on the map entry, faults, updates the pmap to writable at a new phys addr, and starts TLB invalidations... Thread B acquires a lock, writes to a location on the new phys addr, and releases the lock Thread C acquires the lock, reads from the location on the old phys addr... Thread A ...continues the TLB invalidations which are completed Thread C ...reads from the location on the new phys addr, and releases the lock
In this example Thread B and C [lock, use and unlock] properly and neither own the lock at the same time. Thread A was writing somewhere else on the page and so never had/needed the lock. Thread C sees a location that is only ever read|modified under a lock change beneath it while it is the lock owner.
To fix this, perform the two-stage update of the copied PTE. First, the PTE is updated with the address of the new physical page with copied content, but in read-only mode. The pmap locking and the page busy state during PTE update and TLB invalidation IPIs ensure that any writer to the page cannot upgrade the PTE to the writable state until all CPUs updated their TLB to not cache old mapping. Then, after the busy state of the page is lifted, the faults for write can proceed and do not violate the consistency of the reads.
The change is done in vm_fault because most architectures do need IPIs to invalidate remote TLBs. More, I think that hardware guarantees of atomicity of the remote TLB invalidation are not enough to prevent the inconsistent reads of non-atomic reads, like multi-word accesses protected by a lock. So instead of modifying each pmap invalidation code, I did it there.
Discovered and analyzed by: Elliott.Rabe@dell.com Reviewed by: markj PR: 225584 (appeared to have the same cause) Tested by: Elliott.Rabe@dell.com, emaste, Mike Tancsa <mike@sentex.net>, truckman Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14347
show more ...
|
#
607970bc |
| 14-Feb-2018 |
Konstantin Belousov <kib@FreeBSD.org> |
Do not call pmap_enter() with invalid protection mode.
If the map entry elookup was performed due to the mapping changes, we need to ensure that there is still some access permission bit requested w
Do not call pmap_enter() with invalid protection mode.
If the map entry elookup was performed due to the mapping changes, we need to ensure that there is still some access permission bit requested which is compatible with the current vm_map_entry mode. If not, restart the handler from scratch instead of trying to save the current progress.
Also adjust fault_type to not include cleared permission bits.
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14347
show more ...
|
#
72bfb31a |
| 13-Jan-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r327886 through r327930.
|
#
3f289c3f |
| 12-Jan-2018 |
Jeff Roberson <jeff@FreeBSD.org> |
Implement 'domainset', a cpuset based NUMA policy mechanism. This allows userspace to control NUMA policy administratively and programmatically.
Implement domainset based iterators in the page laye
Implement 'domainset', a cpuset based NUMA policy mechanism. This allows userspace to control NUMA policy administratively and programmatically.
Implement domainset based iterators in the page layer.
Remove the now legacy numa_* syscalls.
Cleanup some header polution created by having seq.h in proc.h.
Reviewed by: markj, kib Discussed with: alc Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D13403
show more ...
|
#
796df753 |
| 30-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
SPDX: Consider code from Carnegie-Mellon University.
Interesting cases, most likely from CMU Mach sources.
|
#
937d37fc |
| 19-Nov-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r325842 through r325998.
|
#
df57947f |
| 18-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
spdx: initial adoption of licensing ID tags.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensou
spdx: initial adoption of licensing ID tags.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point.
Initially, only tag files that use BSD 4-Clause "Original" license.
RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133
show more ...
|
Revision tags: release/10.4.0 |
|
#
b754c279 |
| 13-Sep-2017 |
Navdeep Parhar <np@FreeBSD.org> |
MFH @ r323558.
|
#
5be4ad9e |
| 09-Sep-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r323343
|
#
d5efa0a4 |
| 28-Aug-2017 |
Alan Cox <alc@FreeBSD.org> |
Switching from a global hash table to per-vm_object radix tries for mapping vm_object page indices to on-disk swap space (r322913) has changed the synchronization requirements for a couple swap pager
Switching from a global hash table to per-vm_object radix tries for mapping vm_object page indices to on-disk swap space (r322913) has changed the synchronization requirements for a couple swap pager functions. Whereas before a read lock on the vm object sufficed because of the global mutex on the hash table, a write lock on the vm object may now be required. In particular, calls to vm_pager_page_unswapped() now require a write lock on the vm_object. Consequently, vm_fault()'s fast path cannot call vm_pager_page_unswapped(). The swap space will have to be released at a later point.
Reviewed by: kib, markj X-MFC with: r322913 Differential Revision: https://reviews.freebsd.org/D12134
show more ...
|
#
0275f9db |
| 11-Aug-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r321383 through r322397.
|
#
531c2d7a |
| 24-Jul-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r320180
|
#
90ea34bf |
| 23-Jul-2017 |
Alan Cox <alc@FreeBSD.org> |
Address a compilation warning on some architectures that was introduced by the previous change, r321386.
Reported by: ian MFC after: 10 days X-MFC after: r321386
|
#
8b5e1472 |
| 23-Jul-2017 |
Alan Cox <alc@FreeBSD.org> |
Utilize pmap_enter(..., psind=1) in vm_fault_soft_fast() on amd64. (The Differential Revision discusses the benefits of this change.)
Add a function, vm_reserv_to_superpage(), that returns the supe
Utilize pmap_enter(..., psind=1) in vm_fault_soft_fast() on amd64. (The Differential Revision discusses the benefits of this change.)
Add a function, vm_reserv_to_superpage(), that returns the superpage containing the specified base page.
Reviewed by: kib, markj Tested by: pho MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D11556
show more ...
|
#
bca9d05f |
| 23-Jul-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r319973 through 321382.
|
Revision tags: release/11.1.0 |
|
#
a3604b95 |
| 27-Jun-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r320042 through r320397.
|
#
19bd0d9c |
| 24-Jun-2017 |
Konstantin Belousov <kib@FreeBSD.org> |
Implement address space guards.
Guard, requested by the MAP_GUARD mmap(2) flag, prevents the reuse of the allocated address space, but does not allow instantiation of the pages in the range. It is
Implement address space guards.
Guard, requested by the MAP_GUARD mmap(2) flag, prevents the reuse of the allocated address space, but does not allow instantiation of the pages in the range. It is useful for more explicit support for usual two-stage reserve then commit allocators, since it prevents accidental instantiation of the mapping, e.g. by mprotect(2).
Use guards to reimplement stack grow code. Explicitely track stack grow area with the guard, including the stack guard page. On stack grow, trivial shift of the guard map entry and stack map entry limits makes the stack expansion. Move the code to detect stack grow and call vm_map_growstack(), from vm_fault() into vm_map_lookup().
As result, it is impossible to get random mapping to occur in the stack grow area, or to overlap the stack guard page.
Enable stack guard page by default.
Reviewed by: alc, markj Man page update reviewed by: alc, bjk, emaste, markj, pho Tested by: pho, Qualys Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D11306 (man pages)
show more ...
|