diff options
author | alc <alc@FreeBSD.org> | 1999-02-27 23:39:28 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 1999-02-27 23:39:28 +0000 |
commit | 440397c8168a23189c08fea92fe16044cb630cd3 (patch) | |
tree | 706f631a0b86c925d77b2e62f8f0ebb180c9b15e /sys/vm/vnode_pager.c | |
parent | 1c94975d98b0e0e6321db0b8d1a543da215806b9 (diff) | |
download | FreeBSD-src-440397c8168a23189c08fea92fe16044cb630cd3.zip FreeBSD-src-440397c8168a23189c08fea92fe16044cb630cd3.tar.gz |
Reviewed by: "John S. Dyson" <dyson@iquest.net>
Submitted by: Matthew Dillon <dillon@apollo.backplane.com>
To prevent a deadlock, if we are extremely low on memory, force synchronous
operation by the VOP_PUTPAGES in vnode_pager_putpages.
Diffstat (limited to 'sys/vm/vnode_pager.c')
-rw-r--r-- | sys/vm/vnode_pager.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 8cdbca6..4aef81b 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -38,7 +38,7 @@ * SUCH DAMAGE. * * from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91 - * $Id: vnode_pager.c,v 1.102 1999/01/21 08:29:12 dillon Exp $ + * $Id: vnode_pager.c,v 1.103 1999/01/24 02:32:15 dillon Exp $ */ /* @@ -833,6 +833,25 @@ vnode_pager_putpages(object, m, count, sync, rtvals) struct vnode *vp; int bytes = count * PAGE_SIZE; + /* + * Force synchronous operation if we are extremely low on memory + * to prevent a low-memory deadlock. VOP operations often need to + * allocate more memory to initiate the I/O ( i.e. do a BMAP + * operation ). The swapper handles the case by limiting the amount + * of asynchronous I/O, but that sort of solution doesn't scale well + * for the vnode pager without a lot of work. + * + * Also, the backing vnode's iodone routine may not wake the pageout + * daemon up. This should be probably be addressed XXX. + */ + + if ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_pageout_free_min) + sync |= OBJPC_SYNC; + + /* + * Call device-specific putpages function + */ + vp = object->handle; rtval = VOP_PUTPAGES(vp, m, bytes, sync, rtvals, 0); if (rtval == EOPNOTSUPP) { |