diff options
author | kib <kib@FreeBSD.org> | 2013-07-11 20:33:57 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-07-11 20:33:57 +0000 |
commit | ff1a2e73b17e3f6b7324510b60ab7d1f8586f878 (patch) | |
tree | 24bf1de361168430e88fce61be48255c88638c79 | |
parent | b6487bb3f03709742a83a1a25e7f0960ffc04729 (diff) | |
download | FreeBSD-src-ff1a2e73b17e3f6b7324510b60ab7d1f8586f878.zip FreeBSD-src-ff1a2e73b17e3f6b7324510b60ab7d1f8586f878.tar.gz |
When swap pager allocates metadata in the pagedaemon context, allow it
to drain the reserve. This was broken in r243040, causing deadlock.
Note that VM_WAIT call in case of uma_zalloc() failure from pagedaemon
would only wait for the v_pageout_free_min anyway.
Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
-rw-r--r-- | sys/vm/swap_pager.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index ec36442..319811a 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1855,7 +1855,8 @@ retry: if (swapblk == SWAPBLK_NONE) goto done; - swap = *pswap = uma_zalloc(swap_zone, M_NOWAIT); + swap = *pswap = uma_zalloc(swap_zone, M_NOWAIT | + (curproc == pageproc ? M_USE_RESERVE : 0)); if (swap == NULL) { mtx_unlock(&swhash_mtx); VM_OBJECT_WUNLOCK(object); |