summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-07-05 21:39:52 +0000
committerjeff <jeff@FreeBSD.org>2002-07-05 21:39:52 +0000
commit28043f7b73e9714a5886bfe818394f5acffadeb7 (patch)
treed80ac6b224b4436c7430222f1e12fa9d2d54c257 /sys/vm
parent7543c167f6c0d6f185fc8b41a25003c407a18a9f (diff)
downloadFreeBSD-src-28043f7b73e9714a5886bfe818394f5acffadeb7.zip
FreeBSD-src-28043f7b73e9714a5886bfe818394f5acffadeb7.tar.gz
Fix a lock order reversal in uma_zdestroy. The uma_mtx needs to be held across
calls to zone_drain(). Noticed by: scottl
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/uma_core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index 6f99176..1af1122 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -1123,15 +1123,15 @@ zone_dtor(void *arg, int size, void *udata)
zone = (uma_zone_t)arg;
- mtx_lock(&uma_mtx);
- LIST_REMOVE(zone, uz_link);
- mtx_unlock(&uma_mtx);
-
ZONE_LOCK(zone);
zone->uz_wssize = 0;
ZONE_UNLOCK(zone);
+ mtx_lock(&uma_mtx);
+ LIST_REMOVE(zone, uz_link);
zone_drain(zone);
+ mtx_unlock(&uma_mtx);
+
ZONE_LOCK(zone);
if (zone->uz_free != 0)
printf("Zone %s was not empty. Lost %d pages of memory.\n",
OpenPOWER on IntegriCloud