aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_shm.c
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2017-11-08 02:39:37 +0000
committerJeff Roberson <jeff@FreeBSD.org>2017-11-08 02:39:37 +0000
commit8d6fbbb867b02c13a61b18a4a52354fd490927e3 (patch)
tree316821552ce7250dc92da153cc477a9070137432 /sys/kern/uipc_shm.c
parent1ca30d8e1cb49b688a485b2ac137463f6e17942d (diff)
downloadsrc-8d6fbbb867b02c13a61b18a4a52354fd490927e3.tar.gz
src-8d6fbbb867b02c13a61b18a4a52354fd490927e3.zip
Replace manyinstances of VM_WAIT with blocking page allocation flags
similar to the kernel memory allocator. This simplifies NUMA allocation because the domain will be known at wait time and races between failure and sleeping are eliminated. This also reduces boilerplate code and simplifies callers. A wait primitive is supplied for uma zones for similar reasons. This eliminates some non-specific VM_WAIT calls in favor of more explicit sleeps that may be satisfied without new pages. Reviewed by: alc, kib, markj Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon
Notes
Notes: svn path=/head/; revision=325530
Diffstat (limited to 'sys/kern/uipc_shm.c')
-rw-r--r--sys/kern/uipc_shm.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c
index a4fdb85a95c3..c8e5f0d1ccd9 100644
--- a/sys/kern/uipc_shm.c
+++ b/sys/kern/uipc_shm.c
@@ -454,13 +454,10 @@ retry:
if (vm_page_sleep_if_busy(m, "shmtrc"))
goto retry;
} else if (vm_pager_has_page(object, idx, NULL, NULL)) {
- m = vm_page_alloc(object, idx, VM_ALLOC_NORMAL);
- if (m == NULL) {
- VM_OBJECT_WUNLOCK(object);
- VM_WAIT;
- VM_OBJECT_WLOCK(object);
+ m = vm_page_alloc(object, idx,
+ VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL);
+ if (m == NULL)
goto retry;
- }
rv = vm_pager_get_pages(object, &m, 1, NULL,
NULL);
vm_page_lock(m);