aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_shm.c
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2019-10-15 03:45:41 +0000
committerJeff Roberson <jeff@FreeBSD.org>2019-10-15 03:45:41 +0000
commit0012f373e43db2341c20329163ed2d5ad3b0f341 (patch)
tree0ee773797648995271d10676de6c8aadc464785c /sys/kern/uipc_shm.c
parent205be21d997d5becfaee5918386d4087b09f98a8 (diff)
downloadsrc-0012f373e43db2341c20329163ed2d5ad3b0f341.tar.gz
src-0012f373e43db2341c20329163ed2d5ad3b0f341.zip
(4/6) Protect page valid with the busy lock.
Atomics are used for page busy and valid state when the shared busy is held. The details of the locking protocol and valid and dirty synchronization are in the updated vm_page.h comments. Reviewed by: kib, markj Tested by: pho Sponsored by: Netflix, Intel Differential Revision: https://reviews.freebsd.org/D21594
Notes
Notes: svn path=/head/; revision=353539
Diffstat (limited to 'sys/kern/uipc_shm.c')
-rw-r--r--sys/kern/uipc_shm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c
index b0aaac0659a5..e8d1c8f5c40d 100644
--- a/sys/kern/uipc_shm.c
+++ b/sys/kern/uipc_shm.c
@@ -459,7 +459,7 @@ shm_dotruncate_locked(struct shmfd *shmfd, off_t length, void *rl_cookie)
retry:
m = vm_page_grab(object, idx, VM_ALLOC_NOCREAT);
if (m != NULL) {
- MPASS(m->valid == VM_PAGE_BITS_ALL);
+ MPASS(vm_page_all_valid(m));
} else if (vm_pager_has_page(object, idx, NULL, NULL)) {
m = vm_page_alloc(object, idx,
VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL);
@@ -485,7 +485,7 @@ retry:
}
if (m != NULL) {
pmap_zero_page_area(m, base, PAGE_SIZE - base);
- KASSERT(m->valid == VM_PAGE_BITS_ALL,
+ KASSERT(vm_page_all_valid(m),
("shm_dotruncate: page %p is invalid", m));
vm_page_dirty(m);
vm_page_xunbusy(m);