Periodically wake up threads waiting for vmem(9) resources, so they could

ask for resource reclamation again.

This is kind of dirty hack, but as last resort this is better then stuck
indefinitely because of KVA fragmentation, waiting until some random event
free something sufficient.  OpenSolaris also has this hack in its vmem(9).

MFC after:	2 weeks
This commit is contained in:
mav 2015-03-30 13:30:53 +00:00
parent 8560674afd
commit eda1855b80

View File

@ -747,6 +747,12 @@ vmem_periodic(void *unused, int pending)
/* Grow in powers of two. Shrink less aggressively. */
if (desired >= current * 2 || desired * 4 <= current)
vmem_rehash(vm, desired);
/*
* Periodically wake up threads waiting for resources,
* so they could ask for reclamation again.
*/
VMEM_CONDVAR_BROADCAST(vm);
}
mtx_unlock(&vmem_list_lock);