diff options
author | attilio <attilio@FreeBSD.org> | 2013-08-05 08:55:35 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-08-05 08:55:35 +0000 |
commit | 899ab645146d3b9d10334951eb65770773ed3630 (patch) | |
tree | 668bc05fd597966d485deb8ea05c427ee434fde6 /sys/kern/sys_process.c | |
parent | 05101f7501be1dd160855b1f31fcbe7c123817ec (diff) | |
download | FreeBSD-src-899ab645146d3b9d10334951eb65770773ed3630.zip FreeBSD-src-899ab645146d3b9d10334951eb65770773ed3630.tar.gz |
Revert r253939:
We cannot busy a page before doing pagefaults.
Infact, it can deadlock against vnode lock, as it tries to vget().
Other functions, right now, have an opposite lock ordering, like
vm_object_sync(), which acquires the vnode lock first and then
sleeps on the busy mechanism.
Before this patch is reinserted we need to break this ordering.
Sponsored by: EMC / Isilon storage division
Reported by: kib
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r-- | sys/kern/sys_process.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 33fac71..5508dcf 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -263,7 +263,6 @@ proc_rwmem(struct proc *p, struct uio *uio) writing = uio->uio_rw == UIO_WRITE; reqprot = writing ? VM_PROT_COPY | VM_PROT_READ : VM_PROT_READ; fault_flags = writing ? VM_FAULT_DIRTY : VM_FAULT_NORMAL; - fault_flags |= VM_FAULT_IOBUSY; /* * Only map in one page at a time. We don't have to, but it @@ -288,9 +287,9 @@ proc_rwmem(struct proc *p, struct uio *uio) len = min(PAGE_SIZE - page_offset, uio->uio_resid); /* - * Fault and busy the page on behalf of the process. + * Fault and hold the page on behalf of the process. */ - error = vm_fault_handle(map, pageno, reqprot, fault_flags, &m); + error = vm_fault_hold(map, pageno, reqprot, fault_flags, &m); if (error != KERN_SUCCESS) { if (error == KERN_RESOURCE_SHORTAGE) error = ENOMEM; @@ -316,9 +315,9 @@ proc_rwmem(struct proc *p, struct uio *uio) /* * Release the page. */ - VM_OBJECT_WLOCK(m->object); - vm_page_io_finish(m); - VM_OBJECT_WUNLOCK(m->object); + vm_page_lock(m); + vm_page_unhold(m); + vm_page_unlock(m); } while (error == 0 && uio->uio_resid > 0); |