#
d869a17e |
| 06-Mar-2020 |
Mark Johnston <markj@FreeBSD.org> |
Use COUNTER_U64_DEFINE_EARLY() in places where it simplifies things.
Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23978
|
#
75dfc66c |
| 27-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r358269 through r358399.
|
#
7029da5c |
| 26-Feb-2020 |
Pawel Biernacki <kaktus@FreeBSD.org> |
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly mark
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
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
show more ...
|
#
a314aba8 |
| 12-Jan-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
vm: add missing CLTFLAG_MPSAFE annotations
This covers all vm/* files.
|
#
b378d296 |
| 22-Nov-2019 |
Mark Johnston <markj@FreeBSD.org> |
Fix locking in vm_reserv_reclaim_contig().
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 reserva
Fix locking in vm_reserv_reclaim_contig().
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
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 ...
|
#
fe6d5344 |
| 18-Nov-2019 |
Mark Johnston <markj@FreeBSD.org> |
Group per-domain reservation data in the same structure.
We currently have the per-domain partially populated reservation queues and the per-domain queue locks. Define a new per-domain padded struc
Group per-domain reservation data in the same structure.
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
show more ...
|
Revision tags: release/12.1.0 |
|
#
3e5e1b51 |
| 19-Aug-2019 |
Jeff Roberson <jeff@FreeBSD.org> |
Allocate amd64's page array using pages and page directory pages from the NUMA domain that the pages describe. Patch original from gallatin.
Reviewed by: kib Tested by: pho Sponsored by: Netflix Di
Allocate amd64's page array using pages and page directory pages from the 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
show more ...
|
#
6b821a74 |
| 16-Aug-2019 |
Aleksandr Rybalko <ray@FreeBSD.org> |
Check paddr for overflow. 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-0xffff
Check paddr for overflow. 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
show more ...
|
Revision tags: release/11.3.0 |
|
#
e532a999 |
| 20-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @349234
Sponsored by: The FreeBSD Foundation
|
#
f96e8a0b |
| 06-Jun-2019 |
Doug Moore <dougm@FreeBSD.org> |
The means of finding ranges of free pages was changed for vm_reserv_break in r348484, and there was found to improve performance minutely and reduce code size. This change applies a similar change to
The means of finding ranges of free pages was changed for 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
show more ...
|
#
0269ae4c |
| 06-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @348740
Sponsored by: The FreeBSD Foundation
|
#
2d5039db |
| 03-Jun-2019 |
Alan Cox <alc@FreeBSD.org> |
Retire vm_reserv_extend_{contig,page}(). These functions were introduced as part of a false start toward fine-grained reservation locking. In the end, they were not needed, so eliminate them.
Orde
Retire vm_reserv_extend_{contig,page}(). These functions were introduced 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
show more ...
|
#
b8590dae |
| 31-May-2019 |
Doug Moore <dougm@FreeBSD.org> |
The function vm_phys_free_contig invokes vm_phys_free_pages for every power-of-two page block it frees, launching an unsuccessful search for a buddy to pair up with each time. The only possible budd
The function vm_phys_free_contig invokes vm_phys_free_pages for every 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
show more ...
|
#
e67a5068 |
| 28-May-2019 |
Doug Moore <dougm@FreeBSD.org> |
Reduce the code size and number of ffsl calls in vm_reserv_break. Use xor to find where free ranges begin and end.
Tested by: pho Reviewed by:alc Approved by:markj, kib (mentors) Differential Revisi
Reduce the code size and number of ffsl calls in vm_reserv_break. Use 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
show more ...
|
#
f2a496d6 |
| 18-Jan-2019 |
Konstantin Belousov <kib@FreeBSD.org> |
MI VM: Make it possible to set size of superpage at boot instead of compile time.
In order to allow single kernel to use PAE pagetables on i386 if hardware supports it, and fall back to classic two-
MI VM: Make it possible to set size of superpage at boot instead of compile time.
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
show more ...
|
Revision tags: release/12.0.0 |
|
#
2ef6727e |
| 07-Jul-2018 |
Jeff Roberson <jeff@FreeBSD.org> |
Use the ticks since the last update to reduce hysteresis in the partpopq and contention on the vm_reserv_domain lock.
This gives a roughly 8x speedup on will-it-scale fault1 on a 16 core machine.
R
Use the ticks since the last update to reduce hysteresis in the partpopq and 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
show more ...
|
Revision tags: release/11.2.0 |
|
#
2d3f4181 |
| 23-Mar-2018 |
Jeff Roberson <jeff@FreeBSD.org> |
Fix two compliation problems on non-amd64 architectures.
|
#
72346b22 |
| 23-Mar-2018 |
Cy Schubert <cy@FreeBSD.org> |
Fix build on i386 without INVARIANTS following r331369.
--- 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/count
Fix build on i386 without INVARIANTS following r331369.
--- 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@
show more ...
|
#
5c930c89 |
| 22-Mar-2018 |
Jeff Roberson <jeff@FreeBSD.org> |
Lock reservations with a dedicated lock in each reservation. Protect the vmd_free_count with atomics.
This allows us to allocate and free from reservations without the free lock except where a supe
Lock reservations with a dedicated lock in each reservation. Protect the 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
show more ...
|
#
30fbfdda |
| 15-Mar-2018 |
Jeff Roberson <jeff@FreeBSD.org> |
Eliminate pageout wakeup races. Take another step towards lockless vmd_free_count manipulation. Reduce the scope of the free lock by using a pageout lock to synchronize sleep and wakeup. Only trig
Eliminate pageout wakeup races. Take another step towards lockless 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
show more ...
|
#
f4af5959 |
| 07-Mar-2018 |
Jeff Roberson <jeff@FreeBSD.org> |
Don't assert that the domain free lock is held until we're certain that there is a valid reservation. This can trip erroneously when memory falls within a domain but doesn't have the reservation ini
Don't assert that the domain free lock is held until we're certain that 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
show more ...
|
#
5f70fb14 |
| 24-Feb-2018 |
Mark Johnston <markj@FreeBSD.org> |
Correct some comments after r328954.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D14486
|
#
ada27a3b |
| 14-Feb-2018 |
Konstantin Belousov <kib@FreeBSD.org> |
Cleanup unused page argument for vm_reserv_break().
Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14364
|
#
c4be9169 |
| 13-Feb-2018 |
Konstantin Belousov <kib@FreeBSD.org> |
Do not leak rv->psind in some specific situations.
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
Do not leak rv->psind in some specific situations.
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
show more ...
|