From e3c778fa6b461223dddbb660f604681e28dac397 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 10 Nov 2012 11:18:46 +0000 Subject: Number of swap pages in use must be smaller than tha total number of swap pages, so fix non-sensical comparison introduced in rev 1.77. ok miod@, krw@, beck@ --- sys/uvm/uvm_km.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/uvm') diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c index aa97110d6bf..3131053ecc9 100644 --- a/sys/uvm/uvm_km.c +++ b/sys/uvm/uvm_km.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_km.c,v 1.107 2012/03/09 13:01:29 ariane Exp $ */ +/* $OpenBSD: uvm_km.c,v 1.108 2012/11/10 11:18:45 kettenis Exp $ */ /* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */ /* @@ -404,9 +404,10 @@ uvm_km_kmemalloc_pla(struct vm_map *map, struct uvm_object *obj, vsize_t size, */ TAILQ_INIT(&pgl); pla_flags = 0; + KASSERT(uvmexp.swpgonly <= uvmexp.swpages); if ((flags & UVM_KMF_NOWAIT) || ((flags & UVM_KMF_CANFAIL) && - uvmexp.swpgonly - uvmexp.swpages <= atop(size))) + uvmexp.swpages - uvmexp.swpgonly <= atop(size))) pla_flags |= UVM_PLA_NOWAIT; else pla_flags |= UVM_PLA_WAITOK; -- cgit v1.2.3