Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm Until such time as the swap subsystem can be convert...
details: https://anonhg.NetBSD.org/src/rev/605df8ed6b17
branches: trunk
changeset: 782939:605df8ed6b17
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Tue Nov 27 20:15:55 2012 +0000
description:
Until such time as the swap subsystem can be converted to use The One True
Allocator, prevent panics if (MAXPHYS/PAGE_SIZE) > BLIST_MAX_ALLOC.
>From Wolfgang Stukenbrock in PR#41765.
diffstat:
sys/uvm/uvm_swap.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diffs (38 lines):
diff -r 7e30e700b3fb -r 605df8ed6b17 sys/uvm/uvm_swap.c
--- a/sys/uvm/uvm_swap.c Tue Nov 27 20:06:36 2012 +0000
+++ b/sys/uvm/uvm_swap.c Tue Nov 27 20:15:55 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_swap.c,v 1.161 2012/02/05 16:08:28 rmind Exp $ */
+/* $NetBSD: uvm_swap.c,v 1.162 2012/11/27 20:15:55 jakllsch Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 2009 Matthew R. Green
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.161 2012/02/05 16:08:28 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.162 2012/11/27 20:15:55 jakllsch Exp $");
#include "opt_uvmhist.h"
#include "opt_compat_netbsd.h"
@@ -1535,6 +1535,19 @@
return 0;
/*
+ * XXXJAK: BEGIN HACK
+ *
+ * blist_alloc() in subr_blist.c will panic if we try to allocate
+ * too many slots.
+ */
+ if (*nslots > BLIST_MAX_ALLOC) {
+ if (__predict_false(lessok == false))
+ return 0;
+ *nslots = BLIST_MAX_ALLOC;
+ }
+ /* XXXJAK: END HACK */
+
+ /*
* lock data lock, convert slots into blocks, and enter loop
*/
mutex_enter(&uvm_swap_data_lock);
Home |
Main Index |
Thread Index |
Old Index