opnsense-src/sys/vm
Jason A. Harmening 64f4e2bdf5 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

(cherry picked from commit 2619c5ccfe1f7889f0241916bd17d06340142b05)

MFCed as a prerequisite for further MFC of VM domainset changes.  Based
on analysis, it would not hurt, and I have been using it in productions
for months now.

Resolved the trivial conflict due to commit 718d1928f874 ("LinuxKPI:
make linux_alloc_pages() honor __GFP_NORETRY") having been MFCed before
this one.
2025-10-23 08:18:48 +02:00
..
_vm_phys.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
_vm_radix.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
device_pager.c device_pager: rename the un_pager.devp.dev field to handle 2024-11-13 01:19:18 +02:00
memguard.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
memguard.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
phys_pager.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
pmap.h pmap: move the smp_targeted_tlb_shutdown pointer stuff to amd64 pmap.h 2024-07-01 13:07:38 +00:00
redzone.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
redzone.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
sg_pager.c Add sysctl kern.proc.kqueue 2025-04-07 04:28:20 +03:00
swap_pager.c swap_pager: Ensure that swapoff puts swapped-in pages in page queues 2024-11-28 14:38:17 +00:00
swap_pager.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
uma.h uma: Permit specifying max of cache line and some custom alignment 2023-11-16 10:07:18 -05:00
uma_align_mask.h uma: Make the cache alignment mask unsigned 2023-11-16 10:07:16 -05:00
uma_core.c uma: Avoid excessive per-CPU draining 2025-03-31 18:35:33 +00:00
uma_dbg.c uma: Micro-optimize memory trashing 2023-12-08 21:32:43 -05:00
uma_dbg.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
uma_int.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vm.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vm_domainset.c Avoid waiting on physical allocations that can't possibly be satisfied 2025-10-23 08:18:48 +02:00
vm_domainset.h Avoid waiting on physical allocations that can't possibly be satisfied 2025-10-23 08:18:48 +02:00
vm_dumpset.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vm_extern.h vm: Add kva_alloc_aligned 2024-09-02 08:43:18 +00:00
vm_fault.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vm_glue.c thread: Simplify sanitizer integration with thread creation 2025-02-07 14:46:53 +00:00
vm_init.c Adjust comments referencing vm_mem_init() 2024-06-06 11:23:01 -03:00
vm_kern.c Avoid waiting on physical allocations that can't possibly be satisfied 2025-10-23 08:18:48 +02:00
vm_kern.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vm_map.c vm_map: add vm_map_find_locked(9) 2024-10-05 10:08:54 +03:00
vm_map.h vm_map: add vm_map_find_locked(9) 2024-10-05 10:08:54 +03:00
vm_meter.c vm_meter: Fix laundry accounting 2024-10-29 13:04:25 +00:00
vm_mmap.c vm_object: do not assume that un_pager.devp.dev is cdev 2024-11-13 01:19:18 +02:00
vm_object.c vm_object: Make a comment more clear 2025-04-24 13:20:52 +00:00
vm_object.h vm_object: do not assume that un_pager.devp.dev is cdev 2024-11-13 01:19:18 +02:00
vm_page.c Avoid waiting on physical allocations that can't possibly be satisfied 2025-10-23 08:18:48 +02:00
vm_page.h Avoid waiting on physical allocations that can't possibly be satisfied 2025-10-23 08:18:48 +02:00
vm_pageout.c vm_pageout: Disallow invalid values for act_scan_laundry_weight 2025-05-03 20:22:08 +00:00
vm_pageout.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vm_pagequeue.h vm_pageout: Add a chicken switch for multithreaded PQ_INACTIVE scanning 2025-01-23 13:58:07 +00:00
vm_pager.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vm_pager.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
vm_param.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vm_phys.c vm_phys_early_startup(): Panic if phys_avail[] is empty 2025-04-08 15:38:22 +02:00
vm_phys.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vm_radix.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vm_radix.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vm_reserv.c vm_reserv_reclaim_contig: Return NULL not false 2024-04-17 10:33:26 -04:00
vm_reserv.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vm_swapout.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vm_swapout_dummy.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vm_unix.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
vnode_pager.c buf: Add a runningbufclaim() helper 2024-12-06 14:51:09 +00:00
vnode_pager.h Add vnode_pager_clean_{a,}sync(9) 2024-01-18 02:51:33 +02:00