diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-11-10 11:18:46 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-11-10 11:18:46 +0000 |
commit | e3c778fa6b461223dddbb660f604681e28dac397 (patch) | |
tree | 51cef73ad65008797190071c2e6d24e417327c6c | |
parent | 1986f33f0c5a50babe586f18563b49ce7d8b49ba (diff) |
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@
-rw-r--r-- | sys/uvm/uvm_km.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |