git: 839d3266d8c6 - main - uipc_shm.c: make large page allocation interruptible
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 01 May 2026 01:15:45 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=839d3266d8c6f6471cb92a3c0ae32eb16d117427
commit 839d3266d8c6f6471cb92a3c0ae32eb16d117427
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-04-28 02:34:49 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-05-01 01:06:42 +0000
uipc_shm.c: make large page allocation interruptible
in cases there is no page pressure or when the user lost patience
waiting for very large allocation. Other case is already handled by
vm_wait_intr().
Reported by: "Lizzie from Eden Emulator project"
Reviewed by: adrian, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56725
---
sys/kern/uipc_shm.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c
index 0ad5be2e8d71..197409d97f0c 100644
--- a/sys/kern/uipc_shm.c
+++ b/sys/kern/uipc_shm.c
@@ -829,12 +829,20 @@ shm_dotruncate_largepage(struct shmfd *shmfd, off_t length, void *rl_cookie)
* object lock might allowed mapping of them.
*/
while (object->size < newobjsz) {
+ error = sig_intr();
+ if (error != 0)
+ return (error);
m = vm_page_alloc_contig(object, object->size, aflags,
pagesizes[psind] / PAGE_SIZE, 0, ~0,
pagesizes[psind], 0,
VM_MEMATTR_DEFAULT);
if (m == NULL) {
VM_OBJECT_WUNLOCK(object);
+ error = sig_intr();
+ if (error != 0) {
+ VM_OBJECT_WLOCK(object);
+ return (error);
+ }
if (shmfd->shm_lp_alloc_policy ==
SHM_LARGEPAGE_ALLOC_NOWAIT ||
(shmfd->shm_lp_alloc_policy ==