aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/sg_pager.c
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2020-01-19 23:47:32 +0000
committerJeff Roberson <jeff@FreeBSD.org>2020-01-19 23:47:32 +0000
commitd6e13f3b4d5743177ac22f3642b07ba652c1f1a8 (patch)
tree000c91864ae5607a0215d20571ecf7ab0ea66812 /sys/vm/sg_pager.c
parentd1df7fdd040a25a6d61d04a3e04a931aa75f3094 (diff)
downloadsrc-d6e13f3b4d5743177ac22f3642b07ba652c1f1a8.tar.gz
src-d6e13f3b4d5743177ac22f3642b07ba652c1f1a8.zip
Don't hold the object lock while calling getpages.
The vnode pager does not want the object lock held. Moving this out allows further object lock scope reduction in callers. While here add some missing paging in progress calls and an assert. The object handle is now protected explicitly with pip. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D23033
Notes
Notes: svn path=/head/; revision=356902
Diffstat (limited to 'sys/vm/sg_pager.c')
-rw-r--r--sys/vm/sg_pager.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/vm/sg_pager.c b/sys/vm/sg_pager.c
index f5e211ab9bc6..8faaad724f01 100644
--- a/sys/vm/sg_pager.c
+++ b/sys/vm/sg_pager.c
@@ -155,10 +155,9 @@ sg_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind,
/* Since our haspage reports zero after/before, the count is 1. */
KASSERT(count == 1, ("%s: count %d", __func__, count));
- VM_OBJECT_ASSERT_WLOCKED(object);
+ /* Handle is stable while paging is in progress. */
sg = object->handle;
memattr = object->memattr;
- VM_OBJECT_WUNLOCK(object);
offset = m[0]->pindex;
/*
@@ -196,6 +195,7 @@ sg_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind,
VM_OBJECT_WLOCK(object);
TAILQ_INSERT_TAIL(&object->un_pager.sgp.sgp_pglist, page, plinks.q);
vm_page_replace(page, object, offset, m[0]);
+ VM_OBJECT_WUNLOCK(object);
m[0] = page;
vm_page_valid(page);