diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2011-06-23 21:54:57 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2011-06-23 21:54:57 +0000 |
commit | 258371206779554546356c50124b520a32f3b126 (patch) | |
tree | 883800269bd49845d661b3ab24a219f4a32872f4 | |
parent | 2bf964e9a8db39b75fa0d764ebb935ae875a1a3e (diff) |
Don't bother checking for an empty queue before calling uvm_pglistfree.
It will handle an empty list just fine (there's a small optimisation
possible here to avoid grabbing the fpageqlock if no pages need freeing,
but that is definitely another diff)
ok ariane@
-rw-r--r-- | sys/uvm/uvm_km.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c index f3af1016803..24017d5811f 100644 --- a/sys/uvm/uvm_km.c +++ b/sys/uvm/uvm_km.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_km.c,v 1.104 2011/06/23 21:42:05 ariane Exp $ */ +/* $OpenBSD: uvm_km.c,v 1.105 2011/06/23 21:54:56 oga Exp $ */ /* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */ /* @@ -930,8 +930,7 @@ alloc_va: while (uvm_km_pages.free == 0) { if (kd->kd_waitok == 0) { mtx_leave(&uvm_km_pages.mtx); - if (!TAILQ_EMPTY(&pgl)) - uvm_pglistfree(&pgl); + uvm_pglistfree(&pgl); return NULL; } msleep(&uvm_km_pages.free, &uvm_km_pages.mtx, PVM, @@ -964,8 +963,7 @@ try_map: tsleep(map, PVM, "km_allocva", 0); goto try_map; } - if (!TAILQ_EMPTY(&pgl)) - uvm_pglistfree(&pgl); + uvm_pglistfree(&pgl); return (NULL); } } |