- 21 Sep, 2020 1 commit
-
-
D Scott Phillips authored
On an Ampere Altra system, the physical memory is populated sparsely within the physical address space, with only about 0.4% of physical addresses backed by RAM in the range [0, last_pa]. This is causing the vm_reserv_array to be over-sized by a few orders of magnitude, wasting roughly 5 GiB on a system with 256 GiB of RAM. The sparse allocation of vm_reserv_array is controlled by defining VM_PHYSSEG_SPARSE, with the dense allocation still remaining for platforms with VM_PHYSSEG_DENSE. Reviewed by: markj, alc, kib Approved by: scottl (implicit) MFC after: 1 week Sponsored by: Ampere Computing, Inc. Differential Revision: https://reviews.freebsd.org/D26130
-
- 06 Mar, 2020 1 commit
-
-
Mark Johnston authored
Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23978
-
- 26 Feb, 2020 1 commit
-
-
Pawel Biernacki authored
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718
-
- 12 Jan, 2020 1 commit
-
-
Mateusz Guzik authored
This covers all vm/* files.
-
- 22 Nov, 2019 1 commit
-
-
Mark Johnston authored
We were not properly handling the case where the trylock of the reservaton fails, in which case we could leak reservation lock. Introduce a marker reservation to implement precise scanning in vm_reserv_reclaim_contig(). Before, a race could result in early termination of the scan in rare situations. Use the marker's lock to serialize scans of the partpop queue so that a global marker structure can be used. Modify vm_reserv_reclaim_inactive() to handle the presence of a marker while minimizing the hold time of domain-global locks. Reviewed by: alc, jeff, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22392
-
- 19 Nov, 2019 1 commit
-
-
Jeff Roberson authored
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
-
- 18 Nov, 2019 1 commit
-
-
Mark Johnston authored
We currently have the per-domain partially populated reservation queues and the per-domain queue locks. Define a new per-domain padded structure to contain both of them. This puts the queue fields and lock in the same cache line and avoids the false sharing within the old queue array. Also fix field packing in the reservation structure. In many places we assume that a domain index fits in 8 bits, so we can do the same there as well. This reduces the size of the structure by 8 bytes. Update some comments while here. No functional change intended. Reviewed by: dougm, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22391
-
- 18 Aug, 2019 1 commit
-
-
Jeff Roberson authored
NUMA domain that the pages describe. Patch original from gallatin. Reviewed by: kib Tested by: pho Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21252
-
- 16 Aug, 2019 1 commit
-
-
Aleksandr Rybalko authored
Fix panic on initialize of "vm reserv" per-superpage lock in case when RAM ends at upper boundary of address space. Observed on ARM32 board BPI-R2 (2GB RAM 0x80000000-0xffffffff). PR: 235362 Reviewed by: kib, markj, alc MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21272
-
- 06 Jun, 2019 1 commit
-
-
Doug Moore authored
vm_reserv_break in r348484, and there was found to improve performance minutely and reduce code size. This change applies a similar change to vm_reserv_reclaim_config, expecting similar benefits. This change also allows quick rejection of page ranges that are unsuitable on account of alignment or boundary issues, where those issues are processed a page at a time in the current implementation. For contrived test cases, this can make finding a reservation satisfying a major alignment requirement around 30 times faster. Tested by: pho Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D20274
-
- 03 Jun, 2019 1 commit
-
-
Alan Cox authored
as part of a false start toward fine-grained reservation locking. In the end, they were not needed, so eliminate them. Order the parameters to vm_reserv_alloc_{contig,page}() consistently with the vm_page functions that call them. Update the comments about the locking requirements for vm_reserv_alloc_{contig,page}(). They no longer require a free page queues lock. Wrap several lines that became too long after the "req" and "domain" parameters were added to vm_reserv_alloc_{contig,page}(). Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20492
-
- 31 May, 2019 1 commit
-
-
Doug Moore authored
power-of-two page block it frees, launching an unsuccessful search for a buddy to pair up with each time. The only possible buddy-up mergers are across the boundaries of the freed region, so change vm_phys_free_contig simply to enqueue the freed interior blocks, via a new function vm_phys_enqueue_contig, and then call vm_phys_free_pages on the bounding blocks to create as big a cross-boundary block as possible after buddy-merging. The only callers of vm_phys_free_contig at the moment call it in situations where merging blocks across the boundary is clearly impossible, so just call vm_phys_enqueue_contig in those places and avoid trying to buddy-up at all. One beneficiary of this change is in breaking reservations. For the case where memory is freed in breaking a reservation with only the first and last pages allocated, the number of cycles consumed by the operation drops about 11% with this change. Suggested by: alc Reviewed by: alc Approved by: kib, markj (mentors) Differential Revision: https://reviews.freebsd.org/D16901
-
- 28 May, 2019 1 commit
-
-
Doug Moore authored
xor to find where free ranges begin and end. Tested by: pho Reviewed by:alc Approved by:markj, kib (mentors) Differential Revision: https://reviews.freebsd.org/D20256
-
- 18 Jan, 2019 1 commit
-
-
Konstantin Belousov authored
In order to allow single kernel to use PAE pagetables on i386 if hardware supports it, and fall back to classic two-level paging structures if not, superpage code should be able to adopt to either 2M or 4M superpages size. There I make MI VM structures large enough to track the biggest possible superpage, by allowing architecture to define VM_NFREEORDER_MAX and VM_LEVEL_0_ORDER_MAX constants. Corresponding VM_NFREEORDER and VM_LEVEL_0_ORDER symbols can be defined as runtime values and must be less than the _MAX constants. If architecture does not define _MAXs, it is assumed that _MAX == normal constant. Reviewed by: markj Tested by: pho (as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18853
-
- 07 Jul, 2018 1 commit
-
-
Jeff Roberson authored
contention on the vm_reserv_domain lock. This gives a roughly 8x speedup on will-it-scale fault1 on a 16 core machine. Reviewed by: alc, kib, markj
-
- 23 Mar, 2018 2 commits
-
-
Jeff Roberson authored
-
Cy Schubert authored
--- vm_reserv.o --- In file included from /opt/src/svn-current/sys/vm/vm_reserv.c:48: In file included from /opt/src/svn-current/sys/sys/counter.h:37: ./machine/counter.h:174:3: error: implicit declaration of function 'critical_enter' is invalid in C99 [-Werror,-Wimplicit-function-declarat ion] critical_enter(); Reviewed by: jeff@
-
- 22 Mar, 2018 1 commit
-
-
Jeff Roberson authored
vmd_free_count with atomics. This allows us to allocate and free from reservations without the free lock except where a superpage is allocated from the physical layer, which is roughly 1/512 of the operations on amd64. Use the counter api to eliminate cache conention on counters. Reviewed by: markj Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14707
-
- 15 Mar, 2018 1 commit
-
-
Jeff Roberson authored
vmd_free_count manipulation. Reduce the scope of the free lock by using a pageout lock to synchronize sleep and wakeup. Only trigger the pageout daemon on transitions between states. Drive all wakeup operations directly as side-effects from freeing memory rather than requiring an additional function call. Reviewed by: markj, kib Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14612
-
- 07 Mar, 2018 1 commit
-
-
Jeff Roberson authored
there is a valid reservation. This can trip erroneously when memory falls within a domain but doesn't have the reservation initialized because it does not meet size or alignment requirements. Reported by: pho, mjg Sponsored by: Netflix, Dell/EMC Isilon
-
- 23 Feb, 2018 1 commit
-
-
Mark Johnston authored
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D14486
-
- 14 Feb, 2018 1 commit
-
-
Konstantin Belousov authored
Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14364
-
- 13 Feb, 2018 1 commit
-
-
Konstantin Belousov authored
Suppose that we have an object with a mapped superpage, and that all pages in the superpages are held (by some driver). Additionally, suppose that the object is terminated, e.g. because the only process mapping it is exiting. Then the reservation is broken, but the pages cannot be freed until later, when they are unheld. In this situation, the reservation code cannot clean psind, since no pages are freed, and the page is freed and then reused with invalid psind. Clean psind on vm_reserv_break() to avoid the situation. Reported and tested by: Slava Shwartsman Reviewed by: markj Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14335
-
- 06 Feb, 2018 1 commit
-
-
Jeff Roberson authored
global to per-domain state. Protect reservations with the free lock from the domain that they belong to. Refactor to make vm domains more of a first class object. Reviewed by: markj, kib, gallatin Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14000
-
- 12 Jan, 2018 1 commit
-
-
Jeff Roberson authored
reservations by giving each memory domain its own KVA space in vmem that is naturally aligned on superpage boundaries. Reviewed by: alc, markj, kib (some objections) Sponsored by: Netflix, Dell/EMC Isilon Tested by; pho Differential Revision: https://reviews.freebsd.org/D13289
-
- 28 Nov, 2017 1 commit
-
-
Jeff Roberson authored
place. This makes the majority of the phys layer explicitly domain specific. Reviewed by: markj, kib (some objections) Discussed with: alc Tested by: pho Sponsored by: Netflix & Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13014
-
- 27 Nov, 2017 1 commit
-
-
Pedro F. Giffuni authored
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. 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. No functional change intended.
-
- 23 Jul, 2017 1 commit
-
-
Alan Cox authored
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
-
- 17 Apr, 2017 1 commit
-
-
Gleb Smirnoff authored
included via sys/pcpu.h.
-
- 28 Dec, 2016 1 commit
-
-
Alan Cox authored
add support for object types that were previously prohibited because they could contain PG_CACHED pages. Roughly halve the number of radix trie operations performed by vm_page_alloc_contig() using the same approach that is employed by vm_page_alloc(). Also, eliminate the radix trie lookup performed with the free page queues lock held. Tidy up the handling of radix trie insert failures in vm_page_alloc() and vm_page_alloc_contig(). Reviewed by: kib, markj Tested by: pho Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8878
-
- 12 Dec, 2016 1 commit
-
-
Alan Cox authored
independent layer of the virtual memory system. Update some of the nearby comments to eliminate redundancy and improve clarity. In vm/vm_reserv.c, do not use hyphens after adverbs ending in -ly per The Chicago Manual of Style. Update the comment in vm/vm_page.h defining the four types of page queues to reflect the elimination of PG_CACHED pages and the introduction of the laundry queue. Reviewed by: kib, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8752
-
- 15 Nov, 2016 1 commit
-
-
Alan Cox authored
not remove user-space visible fields from vm_cnt or all of the references to cached pages from comments. Those changes will come later.) Reviewed by: kib, markj Tested by: pho Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8497
-
- 19 Dec, 2015 1 commit
-
-
Alan Cox authored
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
-
- 26 Nov, 2015 1 commit
-
-
Alan Cox authored
case that the reservation contained "low", the starting position in the popmap for the free page search was incorrectly calculated. The most likely (and visible) symptom of this error was the assertion failure, "vm_reserv_reclaim_contig: pa is too low".
-
- 06 Aug, 2015 1 commit
-
-
Alan Cox authored
-
- 08 Jun, 2015 1 commit
-
-
Alan Cox authored
Differential Revision: https://reviews.freebsd.org/D2712 Reviewed by: kib Sponsored by: EMC / Isilon Storage Division
-
- 11 Apr, 2015 1 commit
-
-
Alan Cox authored
an infinite loop. Submitted by: Svatopluk Kraus MFC after: 1 week
-
- 14 Mar, 2015 1 commit
-
-
Ian Lepore authored
PR: 195668
-
- 12 Mar, 2015 1 commit
-
-
Ian Lepore authored
PR: 195668
-
- 08 Mar, 2015 1 commit
-
-
Konstantin Belousov authored
Sponsored by: The FreeBSD Foundation MFC after: 1 week
-