diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2019-10-15 03:35:11 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2019-10-15 03:35:11 +0000 |
commit | 63e9755548e4feebf798686ab8bce0cdaaaf7b46 (patch) | |
tree | 73004f9ecd43d157304327e6d0feb4ddf93012af /sys/kern/kern_exec.c | |
parent | f44e7436797617b6c6a42a280befb312f1ebf50f (diff) | |
download | src-63e9755548e4feebf798686ab8bce0cdaaaf7b46.tar.gz src-63e9755548e4feebf798686ab8bce0cdaaaf7b46.zip |
(1/6) Replace busy checks with acquires where it is trival to do so.
This is the first in a series of patches that promotes the page busy field
to a first class lock that no longer requires the object lock for
consistency.
Reviewed by: kib, markj
Tested by: pho
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21548
Notes
Notes:
svn path=/head/; revision=353535
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r-- | sys/kern/kern_exec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 5abced8fbbaa..e1c647ca4f00 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -976,10 +976,14 @@ exec_map_first_page(struct image_params *imgp) #if VM_NRESERVLEVEL > 0 vm_object_color(object, 0); #endif +retry: ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED); if (ma[0]->valid != VM_PAGE_BITS_ALL) { - vm_page_xbusy(ma[0]); + if (vm_page_busy_acquire(ma[0], VM_ALLOC_WAITFAIL) == 0) { + vm_page_unwire_noq(ma[0]); + goto retry; + } if (!vm_pager_has_page(object, 0, NULL, &after)) { if (vm_page_unwire_noq(ma[0])) vm_page_free(ma[0]); |