diff options
author | dyson <dyson@FreeBSD.org> | 1996-05-29 05:12:23 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-05-29 05:12:23 +0000 |
commit | f5f74ba5e1f5a496a425d197033f859f46757350 (patch) | |
tree | 4cdaac6f58ca265e73a63c66265c5ea032d9c575 /sys/vm/default_pager.c | |
parent | f5744ee50d2c102d3330e2c7e1286d73c8510b14 (diff) | |
download | FreeBSD-src-f5f74ba5e1f5a496a425d197033f859f46757350.zip FreeBSD-src-f5f74ba5e1f5a496a425d197033f859f46757350.tar.gz |
Make sure that pageout deadlocks cannot occur. There is a problem
that the datastructures needed to support the swap pager can take
enough space to fully deplete system memory, and cause a deadlock.
This change keeps large objects from being filled with dirty pages
without the appropriate swap pager datastructures. Right now,
default objects greater than 1/4 the size of available system memory
are converted to swap objects, thereby eliminating the risk of deadlock.
Diffstat (limited to 'sys/vm/default_pager.c')
-rw-r--r-- | sys/vm/default_pager.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sys/vm/default_pager.c b/sys/vm/default_pager.c index 92db149..9c7acdf 100644 --- a/sys/vm/default_pager.c +++ b/sys/vm/default_pager.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: default_pager.c,v 1.6 1996/01/19 03:59:36 dyson Exp $ + * $Id: default_pager.c,v 1.7 1996/05/24 05:14:44 dyson Exp $ */ #include <sys/param.h> @@ -125,12 +125,10 @@ default_pager_putpages(object, m, c, sync, rtvals) object->type = OBJT_SWAP; if (swap_pager_swp_alloc(object, M_KERNEL) != 0) { - if (swap_pager_swp_alloc(object, M_NOWAIT) != 0) { - object->type = OBJT_DEFAULT; - for (i = 0; i < c; i++) - rtvals[i] = VM_PAGER_FAIL; - return VM_PAGER_FAIL; - } + object->type = OBJT_DEFAULT; + for (i = 0; i < c; i++) + rtvals[i] = VM_PAGER_FAIL; + return VM_PAGER_FAIL; } return swap_pager_putpages(object, m, c, sync, rtvals); @@ -145,3 +143,13 @@ default_pager_haspage(object, pindex, before, after) { return FALSE; } + +void +default_pager_convert_to_swap(object) + vm_object_t object; +{ + object->type = OBJT_SWAP; + if (swap_pager_swp_alloc(object, M_KERNEL) != 0) { + object->type = OBJT_DEFAULT; + } +} |