Remove stray uma_mtx lock/unlock in zone_drain_wait()
Callers of zone_drain_wait(M_WAITOK) do not need to hold (and were not) the uma_mtx, but we would attempt to unlock and relock the mutex if we had to sleep because the zone was already draining. The M_NOWAIT callers may hold the uma_mtx, but we do not sleep in that case. Reviewed by: jhb MFC after: 3 days
This commit is contained in:
parent
7eb756fab1
commit
6e5254e0d7
@ -897,9 +897,7 @@ zone_drain_wait(uma_zone_t zone, int waitok)
|
||||
while (zone->uz_flags & UMA_ZFLAG_DRAINING) {
|
||||
if (waitok == M_NOWAIT)
|
||||
goto out;
|
||||
mtx_unlock(&uma_mtx);
|
||||
msleep(zone, zone->uz_lockptr, PVM, "zonedrain", 1);
|
||||
mtx_lock(&uma_mtx);
|
||||
}
|
||||
zone->uz_flags |= UMA_ZFLAG_DRAINING;
|
||||
bucket_cache_drain(zone);
|
||||
|
Loading…
x
Reference in New Issue
Block a user