#
55b343f4 |
| 09-Jan-2025 |
Mark Johnston <markj@FreeBSD.org> |
vm_pageout: Add a chicken switch for multithreaded PQ_INACTIVE scanning
Right now we have the vm.pageout_cpus_per_thread tunable which controls the number of threads to start up per CPU per NUMA dom
vm_pageout: Add a chicken switch for multithreaded PQ_INACTIVE scanning
Right now we have the vm.pageout_cpus_per_thread tunable which controls the number of threads to start up per CPU per NUMA domain, but after booting, it's not possible to disable multi-threaded scanning.
There is at least one workload where this mechanism doesn't work well; let's make it possible to disable it without a reboot, to simplify troubleshooting.
Reviewed by: dougm, kib MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D48377
show more ...
|
#
fe1165df |
| 09-Jan-2025 |
Mark Johnston <markj@FreeBSD.org> |
vm_pageout: Make vmd_oom a bool
No functional change intended.
Reviewed by: dougm, kib MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews
vm_pageout: Make vmd_oom a bool
No functional change intended.
Reviewed by: dougm, kib MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D48376
show more ...
|
Revision tags: release/14.2.0, release/13.4.0 |
|
#
3f32a7e4 |
| 16-Jul-2024 |
Bojan Novković <bnovkov@FreeBSD.org> |
vm: Add a KVA arena for M_NEVERFREED allocations
This patch adds a new KVA arena for separating M_NEVERFREED allocations. Separating KVAs for pages that are never freed should facilitate superpage p
vm: Add a KVA arena for M_NEVERFREED allocations
This patch adds a new KVA arena for separating M_NEVERFREED allocations. Separating KVAs for pages that are never freed should facilitate superpage promotion in the kernel.
Differential Revision: https://reviews.freebsd.org/D45997 Reviewed by: alc, kib, markj Tested by: alc
show more ...
|
#
a8693e89 |
| 14-Jul-2024 |
Bojan Novković <bnovkov@FreeBSD.org> |
vm: Introduce vm_page_alloc_nofree_domain
This patch adds a reservation-aware bump allocator intended for allocating NOFREE pages. The main goal of this change is to reduce the long-term fragmentati
vm: Introduce vm_page_alloc_nofree_domain
This patch adds a reservation-aware bump allocator intended for allocating NOFREE pages. The main goal of this change is to reduce the long-term fragmentation issues caused by pages that are never freed during runtime.
The `vm_page_alloc_nofree_domain` routine hands out 0-order pages from a preallocated superpage. Once an active NOFREE superpage fills up, the routine will try to allocate a new one and discard the old one. This routine will get invoked whenever VM_ALLOC_NOFREE is passed to vm_page_alloc_noobj or vm_page_alloc.
Differential Revision: https://reviews.freebsd.org/D45863 Reviewed by: alc, kib, markj Tested by: alc
show more ...
|
Revision tags: release/14.1.0 |
|
#
a216e311 |
| 24-May-2024 |
Ryan Libby <rlibby@FreeBSD.org> |
vm_pageout_scan_inactive: take a lock break
In vm_pageout_scan_inactive, release the object lock when we go to refill the scan batch queue so that someone else has a chance to acquire it. This impr
vm_pageout_scan_inactive: take a lock break
In vm_pageout_scan_inactive, release the object lock when we go to refill the scan batch queue so that someone else has a chance to acquire it. This improves access latency to the object when the pagedaemon is processing many consecutive pages from a single object, and also in any case avoids a hiccup during refill for the last touched object.
Reviewed by: alc, markj (previous version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D45288
show more ...
|
Revision tags: release/13.3.0 |
|
#
29363fb4 |
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl s
sys: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
95ee2897 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
Revision tags: release/13.2.0 |
|
#
9cb6ba29 |
| 21-Jan-2023 |
Andrew Gallatin <gallatin@FreeBSD.org> |
vm: centralize VM_BATCHQUEUE_SIZE definition
Remove the platform-specific definitions of VM_BATCHQUEUE_SIZE for amd64 and powerpc64, and instead treat all 64-bit platforms identically. This has the
vm: centralize VM_BATCHQUEUE_SIZE definition
Remove the platform-specific definitions of VM_BATCHQUEUE_SIZE for amd64 and powerpc64, and instead treat all 64-bit platforms identically. This has the effect of increasing the arm64 and riscv VM_BATCHQUEUE_SIZE to match that of other platforms.
Reviewed by: jhb, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37707
show more ...
|
#
1cac76c9 |
| 14-Dec-2022 |
Andrew Gallatin <gallatin@FreeBSD.org> |
vm: reduce lock contention when processing vm batchqueues
Rather than waiting until the batchqueue is full to acquire the lock & process the queue, we now start trying to acquire the lock using tryl
vm: reduce lock contention when processing vm batchqueues
Rather than waiting until the batchqueue is full to acquire the lock & process the queue, we now start trying to acquire the lock using trylocks when the batchqueue is 1/2 full. This removes almost all contention on the vm pagequeue mutex for for our busy sendfile() based web workload. It also greadly reduces the amount of time a network driver ithread remains blocked on a mutex, and eliminates some packet drops under heavy load.
So that the system does not loose the benefit of processing large batchqueues, I've doubled the size of the batchqueues. This way, when there is no contention, we process the same batch size as before.
This has been run for several months on a busy Netflix server, as well as on my personal desktop.
Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37305
show more ...
|
Revision tags: release/12.4.0, release/13.1.0, release/12.3.0, release/13.0.0 |
|
#
431fb8ab |
| 19-Nov-2020 |
Mark Johnston <markj@FreeBSD.org> |
vm_phys: Try to clean up NUMA KPIs
It can useful for code outside the VM system to look up the NUMA domain of a page backing a virtual or physical address, specifically when creating NUMA-aware data
vm_phys: Try to clean up NUMA KPIs
It can useful for code outside the VM system to look up the NUMA domain of a page backing a virtual or physical address, specifically when creating NUMA-aware data structures. We have _vm_phys_domain() for this, but the leading underscore implies that it's an internal function, and vm_phys.h has dependencies on a number of other headers.
Rename vm_phys_domain() to vm_page_domain(), and _vm_phys_domain() to vm_phys_domain(). Make the latter an inline function.
Add _vm_phys.h and define struct vm_phys_seg there so that it's easier to use in other headers. Include it from vm_page.h so that vm_page_domain() can be defined there.
Include machine/vmparam.h from _vm_phys.h since it depends directly on some constants defined there.
Reviewed by: alc Reviewed by: dougm, kib (earlier versions) Differential Revision: https://reviews.freebsd.org/D27207
show more ...
|
Revision tags: release/12.2.0 |
|
#
de6fc2e3 |
| 15-Aug-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r364082 through r364250.
|
#
440cec3f |
| 12-Aug-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
#
0292c54b |
| 11-Aug-2020 |
Conrad Meyer <cem@FreeBSD.org> |
Add support for multithreading the inactive queue pageout within a domain.
In very high throughput workloads, the inactive scan can become overwhelmed as you have many cores producing pages and a si
Add support for multithreading the inactive queue pageout within a domain.
In very high throughput workloads, the inactive scan can become overwhelmed as you have many cores producing pages and a single core freeing. Since Mark's introduction of batched pagequeue operations, we can now run multiple inactive threads working on independent batches.
To avoid confusing the pid and other control algorithms, I (Jeff) do this in a mpi-like fan out and collect model that is driven from the primary page daemon. It decides whether the shortfall can be overcome with a single thread and if not dispatches multiple threads and waits for their results.
The heuristic is based on timing the pageout activity and averaging a pages-per-second variable which is exponentially decayed. This is visible in sysctl and may be interesting for other purposes.
I (Jeff) have verified that this does indeed double our paging throughput when used with two threads. With four we tend to run into other contention problems. For now I would like to commit this infrastructure with only a single thread enabled.
The number of worker threads per domain can be controlled with the 'vm.pageout_threads_per_domain' tunable.
Submitted by: jeff (earlier version) Discussed with: markj Tested by: pho Sponsored by: probably Netflix (based on contemporary commits) Differential Revision: https://reviews.freebsd.org/D21629
show more ...
|
Revision tags: release/11.4.0 |
|
#
9c770a27 |
| 22-Nov-2019 |
Mark Johnston <markj@FreeBSD.org> |
Simplify vm_pageout_init_domain() and add a "big picture" comment.
Stop subtracting 1024/200 from vmd_page_count/200. I cannot see how such precise accounting can make a difference on modern system
Simplify vm_pageout_init_domain() and add a "big picture" comment.
Stop subtracting 1024/200 from vmd_page_count/200. I cannot see how such precise accounting can make a difference on modern systems.
Add some explanation of what the page daemon does and how it handles memory shortages.
Reviewed by: dougm Discussed with: jeff, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22396
show more ...
|
Revision tags: release/12.1.0 |
|
#
e8bcf696 |
| 16-Sep-2019 |
Mark Johnston <markj@FreeBSD.org> |
Revert r352406, which contained changes I didn't intend to commit.
|
#
41fd4b94 |
| 16-Sep-2019 |
Mark Johnston <markj@FreeBSD.org> |
Fix a couple of nits in r352110.
- Remove a dead variable from the amd64 pmap_extract_and_hold(). - Fix grammar in the vm_page_wire man page.
Reported by: alc Reviewed by: alc, kib Sponsored by: Ne
Fix a couple of nits in r352110.
- Remove a dead variable from the amd64 pmap_extract_and_hold(). - Fix grammar in the vm_page_wire man page.
Reported by: alc Reviewed by: alc, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21639
show more ...
|
#
c5c3ba6b |
| 03-Sep-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r351317 through r351731.
|
#
8b90607f |
| 21-Aug-2019 |
Mark Johnston <markj@FreeBSD.org> |
Simplify vm_page_dequeue() and fix an assertion.
- Add a vm_pagequeue_remove() function to physically remove a page from its queue and update the queue length. - Remove vm_page_pagequeue_lockptr()
Simplify vm_page_dequeue() and fix an assertion.
- Add a vm_pagequeue_remove() function to physically remove a page from its queue and update the queue length. - Remove vm_page_pagequeue_lockptr() and let vm_page_pagequeue() return NULL for dequeued pages. - Avoid unnecessarily reloading the queue index if vm_page_dequeue() loses a race with a concurrent queue operation. - Correct an always-true assertion: vm_page_dequeue() may be called from the page allocator with the page unlocked. The assertion m->order == VM_NFREEORDER simply tests whether the page has been removed from the vm_phys free lists; instead, check whether the page belongs to an object.
Reviewed by: kib MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21341
show more ...
|
#
a63915c2 |
| 28-Jul-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @r350386
Sponsored by: The FreeBSD Foundation
|
#
d9a73522 |
| 08-Jul-2019 |
Mark Johnston <markj@FreeBSD.org> |
Add a per-CPU page cache per VM free pool.
Some workloads benefit from having a per-CPU cache for VM_FREEPOOL_DIRECT pages.
Reviewed by: dougm, kib Discussed with: alc, jeff MFC after: 2 weeks Spon
Add a per-CPU page cache per VM free pool.
Some workloads benefit from having a per-CPU cache for VM_FREEPOOL_DIRECT pages.
Reviewed by: dougm, kib Discussed with: alc, jeff MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20858
show more ...
|
Revision tags: release/11.3.0, release/12.0.0 |
|
#
c6879c6c |
| 23-Oct-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r339015 through r339669.
|
#
01d4e214 |
| 05-Oct-2018 |
Glen Barber <gjb@FreeBSD.org> |
MFH r338661 through r339200.
Sponsored by: The FreeBSD Foundation
|
#
30c5525b |
| 01-Oct-2018 |
Andrew Gallatin <gallatin@FreeBSD.org> |
Allow empty NUMA memory domains to support Threadripper2
The AMD Threadripper 2990WX is basically a slightly crippled Epyc. Rather than having 4 memory controllers, one per NUMA domain, it has only
Allow empty NUMA memory domains to support Threadripper2
The AMD Threadripper 2990WX is basically a slightly crippled Epyc. Rather than having 4 memory controllers, one per NUMA domain, it has only 2 memory controllers enabled. This means that only 2 of the 4 NUMA domains can be populated with physical memory, and the others are empty.
Add support to FreeBSD for empty NUMA domains by:
- creating empty memory domains when parsing the SRAT table, rather than failing to parse the table - not running the pageout deamon threads in empty domains - adding defensive code to UMA to avoid allocating from empty domains - adding defensive code to cpuset to avoid binding to an empty domain Thanks to Jeff for suggesting this strategy.
Reviewed by: alc, markj Approved by: re (gjb@) Differential Revision: https://reviews.freebsd.org/D1683
show more ...
|
#
7847e041 |
| 24-Aug-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r338026 through r338297, and resolve conflicts.
|
#
899fe184 |
| 23-Aug-2018 |
Mark Johnston <markj@FreeBSD.org> |
Add a per-pagequeue pdpages counter.
Expose these counters under the vm.domain sysctl node. The existing vm.stats.vm.v_pdpages sysctl is preserved.
Reviewed by: alc (previous version) Differential
Add a per-pagequeue pdpages counter.
Expose these counters under the vm.domain sysctl node. The existing vm.stats.vm.v_pdpages sysctl is preserved.
Reviewed by: alc (previous version) Differential Revision: https://reviews.freebsd.org/D14666
show more ...
|