svn commit: r280850 - head/sys/kern

Alexander Motin mav at FreeBSD.org
Mon Mar 30 13:30:55 UTC 2015


Author: mav
Date: Mon Mar 30 13:30:53 2015
New Revision: 280850
URL: https://svnweb.freebsd.org/changeset/base/280850

Log:
  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

Modified:
  head/sys/kern/subr_vmem.c

Modified: head/sys/kern/subr_vmem.c
==============================================================================
--- head/sys/kern/subr_vmem.c	Mon Mar 30 13:30:15 2015	(r280849)
+++ head/sys/kern/subr_vmem.c	Mon Mar 30 13:30:53 2015	(r280850)
@@ -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);
 


More information about the svn-src-head mailing list