#
2619c5cc |
| 21-Nov-2023 |
Jason A. Harmening <jah@FreeBSD.org> |
Avoid waiting on physical allocations that can't possibly be satisfied
- Change vm_page_reclaim_contig[_domain] to return an errno instead of a boolean. 0 indicates a successful reclaim, ENOMEM i
Avoid waiting on physical allocations that can't possibly be satisfied
- Change vm_page_reclaim_contig[_domain] to return an errno instead of a boolean. 0 indicates a successful reclaim, ENOMEM indicates lack of available memory to reclaim, with any other error (currently only ERANGE) indicating that reclamation is impossible for the specified address range. Change all callers to only follow up with vm_page_wait* in the ENOMEM case.
- Introduce vm_domainset_iter_ignore(), which marks the specified domain as unavailable for further use by the iterator. Use this function to ignore domains that can't possibly satisfy a physical allocation request. Since WAITOK allocations run the iterators repeatedly, this avoids the possibility of infinitely spinning in domain iteration if no available domain can satisfy the allocation request.
PR: 274252 Reported by: kevans Tested by: kevans Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D42706
show more ...
|
Revision tags: release/14.0.0 |
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0 |
|
#
84c39222 |
| 20-Oct-2021 |
Mark Johnston <markj@FreeBSD.org> |
Convert consumers to vm_page_alloc_noobj_contig()
Remove now-unneeded page zeroing. No functional change intended.
Reviewed by: alc, hselasky, kib MFC after: 1 week Sponsored by: The FreeBSD Found
Convert consumers to vm_page_alloc_noobj_contig()
Remove now-unneeded page zeroing. No functional change intended.
Reviewed by: alc, hselasky, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32006
show more ...
|
#
a4667e09 |
| 20-Oct-2021 |
Mark Johnston <markj@FreeBSD.org> |
Convert vm_page_alloc() callers to use vm_page_alloc_noobj().
Remove page zeroing code from consumers and stop specifying VM_ALLOC_NOOBJ. In a few places, also convert an allocation loop to simply
Convert vm_page_alloc() callers to use vm_page_alloc_noobj().
Remove page zeroing code from consumers and stop specifying VM_ALLOC_NOOBJ. In a few places, also convert an allocation loop to simply use VM_ALLOC_WAITOK.
Similarly, convert vm_page_alloc_domain() callers.
Note that callers are now responsible for assigning the pindex.
Reviewed by: alc, hselasky, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31986
show more ...
|
Revision tags: release/13.0.0, release/12.2.0, release/11.4.0, release/12.1.0 |
|
#
61c1328e |
| 13-Sep-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r352105 through r352307.
|
#
fee2a2fa |
| 09-Sep-2019 |
Mark Johnston <markj@FreeBSD.org> |
Change synchonization rules for vm_page reference counting.
There are several mechanisms by which a vm_page reference is held, preventing the page from being freed back to the page allocator. In pa
Change synchonization rules for vm_page reference counting.
There are several mechanisms by which a vm_page reference is held, preventing the page from being freed back to the page allocator. In particular, holding the page's object lock is sufficient to prevent the page from being freed; holding the busy lock or a wiring is sufficent as well. These references are protected by the page lock, which must therefore be acquired for many per-page operations. This results in false sharing since the page locks are external to the vm_page structures themselves and each lock protects multiple structures.
Transition to using an atomically updated per-page reference counter. The object's reference is counted using a flag bit in the counter. A second flag bit is used to atomically block new references via pmap_extract_and_hold() while removing managed mappings of a page. Thus, the reference count of a page is guaranteed not to increase if the page is unbusied, unmapped, and the object's write lock is held. As a consequence of this, the page lock no longer protects a page's identity; operations which move pages between objects are now synchronized solely by the objects' locks.
The vm_page_wire() and vm_page_unwire() KPIs are changed. The former requires that either the object lock or the busy lock is held. The latter no longer has a return value and may free the page if it releases the last reference to that page. vm_page_unwire_noq() behaves the same as before; the caller is responsible for checking its return value and freeing or enqueuing the page as appropriate. vm_page_wire_mapped() is introduced for use in pmap_extract_and_hold(). It fails if the page is concurrently being unmapped, typically triggering a fallback to the fault handler. vm_page_wire() no longer requires the page lock and vm_page_unwire() now internally acquires the page lock when releasing the last wiring of a page (since the page lock still protects a page's queue state). In particular, synchronization details are no longer leaked into the caller.
The change excises the page lock from several frequently executed code paths. In particular, vm_object_terminate() no longer bounces between page locks as it releases an object's pages, and direct I/O and sendfile(SF_NOCACHE) completions no longer require the page lock. In these latter cases we now get linear scalability in the common scenario where different threads are operating on different files.
__FreeBSD_version is bumped. The DRM ports have been updated to accomodate the KPI changes.
Reviewed by: jeff (earlier version) Tested by: gallatin (earlier version), pho Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20486
show more ...
|
Revision tags: release/11.3.0 |
|
#
e532a999 |
| 20-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @349234
Sponsored by: The FreeBSD Foundation
|
#
88ea538a |
| 07-Jun-2019 |
Mark Johnston <markj@FreeBSD.org> |
Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m).
These calls are not the same in general: the former will dequeue the page if it is enqueued, while the latter will just leave i
Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m).
These calls are not the same in general: the former will dequeue the page if it is enqueued, while the latter will just leave it alone. But, all existing uses of the former apply to unmanaged pages, which are never enqueued in the first place. No functional change intended.
Reviewed by: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20470
show more ...
|
#
0269ae4c |
| 06-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @348740
Sponsored by: The FreeBSD Foundation
|
#
e12be321 |
| 21-May-2019 |
Conrad Meyer <cem@FreeBSD.org> |
Include eventhandler.h in more compilation units
This was enumerated with exhaustive search for sys/eventhandler.h includes, cross-referenced against EVENTHANDLER_* usage with the comm(1) utility.
Include eventhandler.h in more compilation units
This was enumerated with exhaustive search for sys/eventhandler.h includes, cross-referenced against EVENTHANDLER_* usage with the comm(1) utility. Manual checking was performed to avoid redundant includes in some drivers where a common os_bsd.h (for example) included sys/eventhandler.h indirectly, but it is possible some of these are redundant with driver-specific headers in ways I didn't notice.
(These CUs did not show up as missing eventhandler.h in tinderbox.)
X-MFC-With: r347984
show more ...
|
Revision tags: release/12.0.0 |
|
#
592ffb21 |
| 24-Aug-2018 |
Warner Losh <imp@FreeBSD.org> |
Revert drm2 removal.
Revert r338177, r338176, r338175, r338174, r338172
After long consultations with re@, core members and mmacy, revert these changes. Followup changes will be made to mark them a
Revert drm2 removal.
Revert r338177, r338176, r338175, r338174, r338172
After long consultations with re@, core members and mmacy, revert these changes. Followup changes will be made to mark them as deprecated and prent a message about where to find the up-to-date driver. Followup commits will be made to make this clear in the installer. Followup commits to reduce POLA in ways we're still exploring.
It's anticipated that after the freeze, this will be removed in 13-current (with the residual of the drm2 code copied to sys/arm/dev/drm2 for the TEGRA port's use w/o the intel or radeon drivers).
Due to the impending freeze, there was no formal core vote for this. I've been talking to different core members all day, as well as Matt Macey and Glen Barber. Nobody is completely happy, all are grudgingly going along with this. Work is in progress to mitigate the negative effects as much as possible.
Requested by: re@ (gjb, rgrimes)
show more ...
|
Revision tags: release/11.2.0 |
|
#
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 ...
|
Revision tags: release/10.4.0, release/11.1.0 |
|
#
ea1e967c |
| 19-May-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r318380 through r318559.
|
#
ed67acb7 |
| 18-May-2017 |
Mark Johnston <markj@FreeBSD.org> |
Don't bother enqueuing a page immediately before freeing it.
No functional change intended.
MFC after: 1 week
|
Revision tags: release/11.0.1, release/11.0.0, release/10.3.0 |
|
#
b626f5a7 |
| 04-Jan-2016 |
Glen Barber <gjb@FreeBSD.org> |
MFH r289384-r293170
Sponsored by: The FreeBSD Foundation
|
#
9a7cd2e6 |
| 22-Dec-2015 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
MFH @r292599
This includes the pluggable TCP framework and other chnages to the netstack to track for VNET stability.
Security: The FreeBSD Foundation
|
#
c869e672 |
| 19-Dec-2015 |
Alan Cox <alc@FreeBSD.org> |
Introduce a new mechanism for relocating virtual pages to a new physical address and use this mechanism when:
1. kmem_alloc_{attr,contig}() can't find suitable free pages in the physical memory a
Introduce a new mechanism for relocating virtual pages to a new physical address and use this mechanism when:
1. kmem_alloc_{attr,contig}() can't find suitable free pages in the physical memory allocator's free page lists. This replaces the long-standing approach of scanning the inactive and inactive queues, converting clean pages into PG_CACHED pages and laundering dirty pages. In contrast, the new mechanism does not use PG_CACHED pages nor does it trigger a large number of I/O operations.
2. on 32-bit MIPS processors, uma_small_alloc() and the pmap can't find free pages in the physical memory allocator's free page lists that are covered by the direct map. Tested by: adrian
3. ttm_bo_global_init() and ttm_vm_page_alloc_dma32() can't find suitable free pages in the physical memory allocator's free page lists.
In the coming months, I expect that this new mechanism will be applied in other places. For example, balloon drivers should use relocation to minimize fragmentation of the guest physical address space.
Make vm_phys_alloc_contig() a little smarter (and more efficient in some cases). Specifically, use vm_phys_segs[] earlier to avoid scanning free page lists that can't possibly contain suitable pages.
Reviewed by: kib, markj Glanced at: jhb Discussed with: jeff Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D4444
show more ...
|
Revision tags: release/10.2.0 |
|
#
416ba5c7 |
| 22-Jun-2015 |
Navdeep Parhar <np@FreeBSD.org> |
Catch up with HEAD (r280229-r284686).
|
#
76aeda8a |
| 20-Jun-2015 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r284188 through r284643.
|
#
baec3dae |
| 16-Jun-2015 |
Baptiste Daroussin <bapt@FreeBSD.org> |
Merge from head@274131
|
#
2f165380 |
| 15-Jun-2015 |
Andriy Gapon <avg@FreeBSD.org> |
ttm_vm_page_alloc: use vm_page_alloc for pages without dma32 restriction
This change re-organizes code a little bit to extract common pieces of ttm_alloc_new_pages() and ttm_get_pages() into dedicat
ttm_vm_page_alloc: use vm_page_alloc for pages without dma32 restriction
This change re-organizes code a little bit to extract common pieces of ttm_alloc_new_pages() and ttm_get_pages() into dedicated functions. Also, for requests without address restrictions regular vm_page_alloc() is used. Lastly, when vm_page_alloc_contig() fails we call VM_WAIT before calling vm_pageout_grow_cache() to ensure that there is enough free pages at all.
Reviewed by: kib MFC after: 15 days
show more ...
|
#
98e0ffae |
| 27-May-2015 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Merge sync of head
|
#
9f3d45b6 |
| 08-Feb-2015 |
Baptiste Daroussin <bapt@FreeBSD.org> |
Merge from HEAD
|
#
a403ab7f |
| 04-Feb-2015 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r278110 through r278223.
|
#
98173b7f |
| 03-Feb-2015 |
Konstantin Belousov <kib@FreeBSD.org> |
If the vm_page_alloc_contig() failed in the ttm page allocators, do what other callers of vm_page_alloc_contig() do, retry after vm_pageout_grow_cache().
Sponsored by: The FreeBSD Foundation
|